fix specs for 404

This commit is contained in:
Alexander Machehin 2013-07-23 01:27:55 +06:00
parent 0d37f4e88e
commit b215d5acd3
4 changed files with 15 additions and 15 deletions

View File

@ -88,6 +88,16 @@ describe Api::V1::IssuesController do
get :user_index, :format => :json
response.should render_template('api/v1/issues/index')
end
it 'should return 404' do
get :show, :project_id => @project.id, :id => 999999, :format => :json
response.status.should == 404
end
it 'should redirect to pull request page' do
get :show, :project_id => @project.id, :id => @pull.serial_id, :format => :json
response.should redirect_to(api_v1_project_pull_request_path(@project.id, @pull.serial_id))
end
end
context 'for anonymous user' do
@ -106,16 +116,6 @@ describe Api::V1::IssuesController do
response.status.should == 401
end
end
it 'should return 404' do
get :show, :project_id => @project.id, :id => (@issue.serial_id + 10), :format => :json
response.status.should == 404
end
it 'should redirect to pull request page' do
get :show, :project_id => @project.id, :id => @pull.serial_id, :format => :json
response.should redirect_to(api_v1_project_pull_request_path(@project.id, @pull.serial_id))
end
end
context 'create accessibility' do

View File

@ -114,7 +114,7 @@ describe Api::V1::PullRequestsController do
end
it 'should return 404' do
get :show, :project_id => @project.id, :id => (@pull.serial_id+10), :format => :json
get :show, :project_id => @project.id, :id => 999999, :format => :json
response.status.should == 404
end

View File

@ -221,8 +221,8 @@ describe Projects::IssuesController do
# end
it 'should return 404' do
get :show, :owner_name => @project.owner.uname, :project_name => @project.name, :id => (@issue.serial_id+10)
response.status.should == 404
get :show, :owner_name => @project.owner.uname, :project_name => @project.name, :id => 999999
render_template(:file => "#{Rails.root}/public/404.html")
end
it 'should redirect to pull request page' do

View File

@ -211,8 +211,8 @@ describe Projects::PullRequestsController do
it_should_behave_like 'pull request when project with issues turned off'
it 'should return 404' do
get :show, :owner_name => @project.owner.uname, :project_name => @project.name, :id => (@pull.serial_id+10)
response.status.should == 404
get :show, :owner_name => @project.owner.uname, :project_name => @project.name, :id => 999999
render_template(:file => "#{Rails.root}/public/404.html")
end
it 'should redirect to issue page' do