Fix asciicast page when its author has other asciicasts

This commit is contained in:
Marcin Kulik 2013-05-28 00:38:04 +02:00
parent d49363687b
commit 078b04e3a1
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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)