gitlab-org--gitlab-foss/spec/controllers/ci/commits_controller_spec.rb

28 lines
805 B
Ruby
Raw Normal View History

2015-08-25 21:42:46 -04:00
require "spec_helper"
describe Ci::CommitsController do
2015-08-25 21:42:46 -04:00
before do
@project = FactoryGirl.create :ci_project
2015-08-25 21:42:46 -04:00
end
describe "GET /status" do
it "returns status of commit" do
commit = FactoryGirl.create :ci_commit, project: @project
2015-08-25 21:42:46 -04:00
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
2015-08-25 21:42:46 -04:00
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