Fix UsersController#show
This commit is contained in:
parent
a6bbdf7a39
commit
7659fe722e
@ -4,7 +4,7 @@ class UsersController < ApplicationController
|
||||
before_filter :ensure_authenticated!, :only => [:edit, :update]
|
||||
|
||||
def show
|
||||
@user = UserDecorator.find_by_nickname!(params[:nickname])
|
||||
@user = User.find_by_nickname!(params[:nickname]).decorate
|
||||
|
||||
collection = @user.asciicasts.
|
||||
includes(:user).
|
||||
@ -12,7 +12,7 @@ class UsersController < ApplicationController
|
||||
page(params[:page]).
|
||||
per(PER_PAGE)
|
||||
|
||||
@asciicasts = AsciicastDecorator.decorate(collection)
|
||||
@asciicasts = PaginatingDecorator.new(collection)
|
||||
end
|
||||
|
||||
def create
|
||||
|
17
spec/features/user_spec.rb
Normal file
17
spec/features/user_spec.rb
Normal file
@ -0,0 +1,17 @@
|
||||
require 'spec_helper'
|
||||
|
||||
feature "User's profile" do
|
||||
|
||||
let!(:user) { create(:user) }
|
||||
let!(:asciicast) { create(:asciicast, :user => user, :title => 'Tricks!') }
|
||||
|
||||
scenario 'Visiting' do
|
||||
visit profile_path(user)
|
||||
|
||||
expect(page).to have_content(/Asciicasts by ~#{user.nickname}/i)
|
||||
expect(page).to have_content('1 asciicasts')
|
||||
expect(page).to have_link('Tricks!')
|
||||
expect(page).to have_selector('.supplimental .play-button')
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user