summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/branches_controller_spec.rb
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-02-22 09:20:04 +0100
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2016-03-15 20:21:11 +0100
commit2b97c921196a7be904bfe4f0a31347c3583c9e88 (patch)
treee650acbaa92c45882f0a4681e67b5e07d5cf7d46 /spec/controllers/projects/branches_controller_spec.rb
parente831a3b869cbb82e9a4294a5f9309ba56df46589 (diff)
downloadgitlab-ce-2b97c921196a7be904bfe4f0a31347c3583c9e88.tar.gz
Incorporate review
Diffstat (limited to 'spec/controllers/projects/branches_controller_spec.rb')
-rw-r--r--spec/controllers/projects/branches_controller_spec.rb19
1 files changed, 14 insertions, 5 deletions
diff --git a/spec/controllers/projects/branches_controller_spec.rb b/spec/controllers/projects/branches_controller_spec.rb
index b509714e75c..98ae424ed7c 100644
--- a/spec/controllers/projects/branches_controller_spec.rb
+++ b/spec/controllers/projects/branches_controller_spec.rb
@@ -66,21 +66,30 @@ describe Projects::BranchesController do
describe "created from the new branch button on issues" do
let(:branch) { "1-feature-branch" }
- let!(:issue) { create(:issue) }
+ let!(:issue) { create(:issue, project: project) }
- before do
+
+ it 'redirects' do
post :create,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
branch_name: branch,
- issue_id: issue.id
- end
+ issue_iid: issue.iid
- it 'redirects' do
expect(subject).
to redirect_to("/#{project.path_with_namespace}/tree/1-feature-branch")
end
+ it 'posts a system note' do
+ expect(SystemNoteService).to receive(:new_issue_branch).with(issue, project, user, "1-feature-branch")
+
+ post :create,
+ namespace_id: project.namespace.to_param,
+ project_id: project.to_param,
+ branch_name: branch,
+ issue_iid: issue.iid
+ end
+
end
end