diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-09 13:37:50 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-09 13:37:50 +0200 |
commit | 76c6aeb9bc9855e9a65bb08db862e92ac923255e (patch) | |
tree | 3494f9854f8f9e2c14f909c7132691f652d13ebc /spec/controllers/ci/commits_controller_spec.rb | |
parent | 3d6fed54f0dc551d8c7ba9a03f4dfbd2203552b5 (diff) | |
download | gitlab-ce-76c6aeb9bc9855e9a65bb08db862e92ac923255e.tar.gz |
Merge CI factories and CI spec/support with GitLab
Diffstat (limited to 'spec/controllers/ci/commits_controller_spec.rb')
-rw-r--r-- | spec/controllers/ci/commits_controller_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/controllers/ci/commits_controller_spec.rb b/spec/controllers/ci/commits_controller_spec.rb new file mode 100644 index 00000000000..b71e7505731 --- /dev/null +++ b/spec/controllers/ci/commits_controller_spec.rb @@ -0,0 +1,27 @@ +require "spec_helper" + +describe Ci::CommitsController do + before do + @project = FactoryGirl.create :ci_project + end + + describe "GET /status" do + it "returns status of commit" do + commit = FactoryGirl.create :ci_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 :ci_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 |