diff --git a/app/decorators/asciicast_decorator.rb b/app/decorators/asciicast_decorator.rb index 60219a7..df7caba 100644 --- a/app/decorators/asciicast_decorator.rb +++ b/app/decorators/asciicast_decorator.rb @@ -81,7 +81,7 @@ class AsciicastDecorator < ApplicationDecorator def other_by_user if user - AsciicastDecorator.decorate( + AsciicastDecorator.decorate_collection( user.asciicasts.where('id <> ?', model.id).limit(3) ) else diff --git a/spec/features/asciicast_spec.rb b/spec/features/asciicast_spec.rb index 7eb0f45..81d19b1 100644 --- a/spec/features/asciicast_spec.rb +++ b/spec/features/asciicast_spec.rb @@ -2,7 +2,9 @@ require 'spec_helper' 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 visit asciicast_path(asciicast)