Commit 562b5015 authored by Grzegorz Bizon's avatar Grzegorz Bizon Committed by Filipa Lacerda

Add basic specs for new merge requests pipelines API

parent 921141ae
...@@ -22,23 +22,35 @@ describe Projects::MergeRequestsController do ...@@ -22,23 +22,35 @@ describe Projects::MergeRequestsController do
render_views render_views
let(:fork_project) { create(:forked_project_with_submodules) } let(:fork_project) { create(:forked_project_with_submodules) }
before { fork_project.team << [user, :master] }
before do context 'when rendering HTML response' do
fork_project.team << [user, :master] it 'renders new merge request widget template' do
submit_new_merge_request
expect(response).to be_success
end
end end
it 'renders it' do context 'when rendering JSON response' do
get :new, it 'renders JSON including serialized pipelines' do
namespace_id: fork_project.namespace.to_param, submit_new_merge_request(format: :json)
project_id: fork_project.to_param,
merge_request: {
source_branch: 'remove-submodule',
target_branch: 'master'
}
expect(response).to be_success expect(json_response).to have_key('pipelines')
expect(response).to be_ok
end
end end
end end
def submit_new_merge_request(format: :html)
get :new,
namespace_id: fork_project.namespace.to_param,
project_id: fork_project.to_param,
merge_request: {
source_branch: 'remove-submodule',
target_branch: 'master' },
format: format
end
end end
shared_examples "loads labels" do |action| shared_examples "loads labels" do |action|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment