#349: updated specs according to comments

This commit is contained in:
Vokhmin Alexey V 2012-10-02 21:22:24 +04:00
parent ecae06db81
commit 9fd8a5a8d1
1 changed files with 7 additions and 11 deletions

View File

@ -15,17 +15,13 @@ describe Users::ProfileController do
end
context 'for guest' do
if APP_CONFIG['anonymous_access']
it 'should be able to view profile' do
get :show, :uname => @simple_user.uname
response.code.should eq('200')
end
else
it 'should not be able to perform show action' do
get :show, :uname => @simple_user.uname
response.should redirect_to(new_user_session_path)
end
it 'should be able to view profile', :anonymous_access => true do
get :show, :uname => @simple_user.uname
response.code.should eq('200')
end
it 'should not be able to perform show action', :anonymous_access => false do
get :show, :uname => @simple_user.uname
response.should redirect_to(new_user_session_path)
end
end