[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,11 +16,19 @@ describe Git::TreesController do
end
context 'for guest' do
it 'should be able to perform archive action' do
if APP_CONFIG['anonymous_access']
it 'should be able to perform archive action with anonymous acccess' do
fill_project
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
context 'for other user' do
@ -45,6 +53,8 @@ describe Git::TreesController do
end
it 'should be able to perform archive action' do
@user = FactoryGirl.create(:user)
set_session_for(@user)
fill_project
get :archive, @params
response.should be_success