Fix asciicast page when its author has other asciicasts
This commit is contained in:
parent
d49363687b
commit
078b04e3a1
@ -81,7 +81,7 @@ class AsciicastDecorator < ApplicationDecorator
|
|||||||
|
|
||||||
def other_by_user
|
def other_by_user
|
||||||
if user
|
if user
|
||||||
AsciicastDecorator.decorate(
|
AsciicastDecorator.decorate_collection(
|
||||||
user.asciicasts.where('id <> ?', model.id).limit(3)
|
user.asciicasts.where('id <> ?', model.id).limit(3)
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
|
@ -2,7 +2,9 @@ require 'spec_helper'
|
|||||||
|
|
||||||
feature "Asciicast page", :js => true do
|
feature "Asciicast page", :js => true do
|
||||||
|
|
||||||
let(:asciicast) { load_asciicast(1) }
|
let!(:user) { create(:user) }
|
||||||
|
let!(:asciicast) { create(:asciicast, :user => user) }
|
||||||
|
let!(:other_asciicast) { create(:asciicast, :user => user) }
|
||||||
|
|
||||||
scenario 'Visiting as guest' do
|
scenario 'Visiting as guest' do
|
||||||
visit asciicast_path(asciicast)
|
visit asciicast_path(asciicast)
|
||||||
|
Loading…
Reference in New Issue
Block a user