diff options
| author | Valery Sizov <vsv2711@gmail.com> | 2015-06-23 13:19:42 +0300 |
|---|---|---|
| committer | Valery Sizov <vsv2711@gmail.com> | 2015-06-23 13:32:22 +0300 |
| commit | b9b466204e6d8ad174488d2a9a2f0e7ef7c41e55 (patch) | |
| tree | b606772f6d18ff238d2fa4c20dc05bd6c3689fef /spec | |
| parent | 01b79e8c2d10cdf0560e5653934f461d876405be (diff) | |
| download | gitlab-ci-commit_not_found_error.tar.gz | |
not_found status of commitcommit_not_found_error
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/controllers/commits_controller_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/controllers/commits_controller_spec.rb b/spec/controllers/commits_controller_spec.rb new file mode 100644 index 0000000..f32d6f8 --- /dev/null +++ b/spec/controllers/commits_controller_spec.rb @@ -0,0 +1,27 @@ +require "spec_helper" + +describe CommitsController do + before do + @project = FactoryGirl.create :project + end + + describe "GET /status" do + it "returns status of commit" do + commit = FactoryGirl.create :commit, project: @project + get :status, id: commit.sha, ref_id: commit.ref, project_id: @project.id + + expect(response).to be_success + expect(response.code).to eq('200') + JSON.parse(response.body)["status"] == "pending" + end + + it "returns not_found status" do + commit = FactoryGirl.create :commit, project: @project + get :status, id: commit.sha, ref_id: "deploy", project_id: @project.id + + expect(response).to be_success + expect(response.code).to eq('200') + JSON.parse(response.body)["status"] == "not_found" + end + end +end |
