Commit b954f244 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix MR controller tests

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 4710a76a
...@@ -3,12 +3,11 @@ require 'spec_helper' ...@@ -3,12 +3,11 @@ require 'spec_helper'
describe Projects::MergeRequestsController do describe Projects::MergeRequestsController do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project, target_branch: "stable", source_branch: "master") } let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) }
before do before do
sign_in(user) sign_in(user)
project.team << [user, :master] project.team << [user, :master]
Projects::MergeRequestsController.any_instance.stub(validates_merge_request: true, )
end end
describe "#show" do describe "#show" do
...@@ -61,7 +60,7 @@ describe Projects::MergeRequestsController do ...@@ -61,7 +60,7 @@ describe Projects::MergeRequestsController do
it "should really be a git email patch with commit" do it "should really be a git email patch with commit" do
get :show, project_id: project.to_param, id: merge_request.iid, format: format get :show, project_id: project.to_param, id: merge_request.iid, format: format
expect(response.body[0..100]).to start_with("From 6ea87c47f0f8a24ae031c3fff17bc913889ecd00") expect(response.body[0..100]).to start_with("From #{merge_request.commits.last.id}")
end end
it "should contain git diffs" do it "should contain git diffs" do
......
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