diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-06-06 20:23:19 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-06-06 21:19:07 +0800 |
commit | e86e1e515a7a4e4e1ee53d3d33bdfebfddd226a6 (patch) | |
tree | 42b4d18a02ca2307dcbc6c0a262904ee3427c0fa /spec/requests | |
parent | 9984f07a28273035d6c989913cb76c9c371965d0 (diff) | |
download | gitlab-ce-e86e1e515a7a4e4e1ee53d3d33bdfebfddd226a6.tar.gz |
Try to report why it's failing and fix tests
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/ci/api/triggers_spec.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/requests/ci/api/triggers_spec.rb b/spec/requests/ci/api/triggers_spec.rb index 26b03c0f148..e481ca916ab 100644 --- a/spec/requests/ci/api/triggers_spec.rb +++ b/spec/requests/ci/api/triggers_spec.rb @@ -5,7 +5,14 @@ describe Ci::API::Triggers do let!(:trigger_token) { 'secure token' } let!(:project) { create(:project, :repository, ci_id: 10) } let!(:project2) { create(:empty_project, ci_id: 11) } - let!(:trigger) { create(:ci_trigger, project: project, token: trigger_token) } + + let!(:trigger) do + create(:ci_trigger, + project: project, + token: trigger_token, + owner: create(:user)) + end + let(:options) do { token: trigger_token @@ -14,6 +21,8 @@ describe Ci::API::Triggers do before do stub_ci_pipeline_to_return_yaml_file + + project.add_developer(trigger.owner) end context 'Handles errors' do @@ -47,7 +56,8 @@ describe Ci::API::Triggers do it 'returns bad request with no builds created if there\'s no commit for that ref' do post ci_api("/projects/#{project.ci_id}/refs/other-branch/trigger"), options expect(response).to have_http_status(400) - expect(json_response['message']).to eq('No builds created') + expect(json_response['message']['base']) + .to contain_exactly('Reference not found') end context 'Validates variables' do |