diff options
Diffstat (limited to 'spec/controllers/projects/branches_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/branches_controller_spec.rb | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/spec/controllers/projects/branches_controller_spec.rb b/spec/controllers/projects/branches_controller_spec.rb index 5b59534cb49..85d3044993e 100644 --- a/spec/controllers/projects/branches_controller_spec.rb +++ b/spec/controllers/projects/branches_controller_spec.rb @@ -217,7 +217,7 @@ describe Projects::BranchesController do } expect(response.location).to include(project_new_blob_path(project, branch)) - expect(response).to have_gitlab_http_status(302) + expect(response).to have_gitlab_http_status(:found) end end @@ -238,7 +238,7 @@ describe Projects::BranchesController do } expect(response.location).to include(project_new_blob_path(project, branch)) - expect(response).to have_gitlab_http_status(302) + expect(response).to have_gitlab_http_status(:found) end end @@ -289,7 +289,7 @@ describe Projects::BranchesController do it 'returns a successful 200 response' do create_branch name: 'my-branch', ref: 'master' - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end it 'returns the created branch' do @@ -303,7 +303,7 @@ describe Projects::BranchesController do it 'returns an unprocessable entity 422 response' do create_branch name: "<script>alert('merge');</script>", ref: "<script>alert('ref');</script>" - expect(response).to have_gitlab_http_status(422) + expect(response).to have_gitlab_http_status(:unprocessable_entity) end end @@ -335,7 +335,7 @@ describe Projects::BranchesController do project_id: project } - expect(response).to have_gitlab_http_status(303) + expect(response).to have_gitlab_http_status(:see_other) end end @@ -361,28 +361,28 @@ describe Projects::BranchesController do context "valid branch name, valid source" do let(:branch) { "feature" } - it { expect(response).to have_gitlab_http_status(200) } + it { expect(response).to have_gitlab_http_status(:ok) } it { expect(response.body).to be_blank } end context "valid branch name with unencoded slashes" do let(:branch) { "improve/awesome" } - it { expect(response).to have_gitlab_http_status(200) } + it { expect(response).to have_gitlab_http_status(:ok) } it { expect(response.body).to be_blank } end context "valid branch name with encoded slashes" do let(:branch) { "improve%2Fawesome" } - it { expect(response).to have_gitlab_http_status(200) } + it { expect(response).to have_gitlab_http_status(:ok) } it { expect(response.body).to be_blank } end context "invalid branch name, valid ref" do let(:branch) { "no-branch" } - it { expect(response).to have_gitlab_http_status(404) } + it { expect(response).to have_gitlab_http_status(:not_found) } it { expect(response.body).to be_blank } end end @@ -398,7 +398,7 @@ describe Projects::BranchesController do expect(json_response).to eql("message" => 'Branch was deleted') end - it { expect(response).to have_gitlab_http_status(200) } + it { expect(response).to have_gitlab_http_status(:ok) } end context 'valid branch name with unencoded slashes' do @@ -408,7 +408,7 @@ describe Projects::BranchesController do expect(json_response).to eql('message' => 'Branch was deleted') end - it { expect(response).to have_gitlab_http_status(200) } + it { expect(response).to have_gitlab_http_status(:ok) } end context "valid branch name with encoded slashes" do @@ -418,7 +418,7 @@ describe Projects::BranchesController do expect(json_response).to eql('message' => 'Branch was deleted') end - it { expect(response).to have_gitlab_http_status(200) } + it { expect(response).to have_gitlab_http_status(:ok) } end context 'invalid branch name, valid ref' do @@ -428,7 +428,7 @@ describe Projects::BranchesController do expect(json_response).to eql('message' => 'No such branch') end - it { expect(response).to have_gitlab_http_status(404) } + it { expect(response).to have_gitlab_http_status(:not_found) } end end @@ -478,7 +478,7 @@ describe Projects::BranchesController do it 'responds with status 404' do destroy_all_merged - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end end @@ -519,7 +519,7 @@ describe Projects::BranchesController do state: 'all' } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end end @@ -537,7 +537,7 @@ describe Projects::BranchesController do state: 'all' } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end end @@ -594,7 +594,7 @@ describe Projects::BranchesController do names: %w[fix add-pdf-file branch-merged] } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response).to eq( "fix" => { "behind" => 29, "ahead" => 2 }, "branch-merged" => { "behind" => 1, "ahead" => 0 }, @@ -612,7 +612,7 @@ describe Projects::BranchesController do project_id: project } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response.count).to be > 1 end @@ -629,7 +629,7 @@ describe Projects::BranchesController do project_id: project } - expect(response).to have_gitlab_http_status(422) + expect(response).to have_gitlab_http_status(:unprocessable_entity) expect(json_response['error']).to eq("Specify at least one and at most #{Kaminari.config.default_per_page} branch names") end @@ -642,7 +642,7 @@ describe Projects::BranchesController do names: %w[fix add-pdf-file branch-merged] } - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response.count).to be > 1 end end |