diff --git a/spec/controllers/api/v1/issues_controller_spec.rb b/spec/controllers/api/v1/issues_controller_spec.rb index 0f0f41c8b..c1546fcf5 100644 --- a/spec/controllers/api/v1/issues_controller_spec.rb +++ b/spec/controllers/api/v1/issues_controller_spec.rb @@ -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 diff --git a/spec/controllers/api/v1/pull_requests_controller.rb b/spec/controllers/api/v1/pull_requests_controller.rb index c4413cafa..e3469a172 100644 --- a/spec/controllers/api/v1/pull_requests_controller.rb +++ b/spec/controllers/api/v1/pull_requests_controller.rb @@ -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 diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index e059cc400..3e0a0d7d3 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -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 diff --git a/spec/controllers/projects/pull_requests_controller_spec.rb b/spec/controllers/projects/pull_requests_controller_spec.rb index 49bb4313c..2eff7d9bb 100644 --- a/spec/controllers/projects/pull_requests_controller_spec.rb +++ b/spec/controllers/projects/pull_requests_controller_spec.rb @@ -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