[refs #416] fixed tests for anonymous access

This commit is contained in:
Alexander Machehin 2012-04-25 00:34:36 +06:00
parent f1cf96baab
commit 843ebecf71
1 changed files with 14 additions and 4 deletions

View File

@ -16,10 +16,18 @@ describe Git::TreesController do
end end
context 'for guest' do context 'for guest' do
it 'should be able to perform archive action' do if APP_CONFIG['anonymous_access']
fill_project it 'should be able to perform archive action with anonymous acccess' do
get :archive, @params fill_project
response.should be_success get :archive, @params
response.should be_success
end
else
it 'should not be able to perform archive action without anonymous acccess' do
fill_project
get :archive, @params
response.code.should == '401'
end
end end
end end
@ -45,6 +53,8 @@ describe Git::TreesController do
end end
it 'should be able to perform archive action' do it 'should be able to perform archive action' do
@user = FactoryGirl.create(:user)
set_session_for(@user)
fill_project fill_project
get :archive, @params get :archive, @params
response.should be_success response.should be_success