summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2016-12-29 13:30:50 -0600
committerMike Greiling <mike@pixelcog.com>2017-01-03 13:08:52 -0600
commit6e7e5052374d67c0b3ed6cac3f62a29778d10858 (patch)
tree675f7e7a6025628c4e34bc4755a1a16a836d4acb
parent0ea54833115ebc47d2e3f82a270b6a0a3334c837 (diff)
downloadgitlab-ce-26155-merge-request-tabs-don-t-render-when-no-commits-available.tar.gz
include all expected instance vars for _show.html.haml template within tests26155-merge-request-tabs-don-t-render-when-no-commits-available
-rw-r--r--app/views/projects/notes/_notes_with_form.html.haml2
-rw-r--r--spec/views/projects/merge_requests/show.html.haml_spec.rb7
2 files changed, 7 insertions, 2 deletions
diff --git a/app/views/projects/notes/_notes_with_form.html.haml b/app/views/projects/notes/_notes_with_form.html.haml
index 00b62a595ff..4c12ecac3c9 100644
--- a/app/views/projects/notes/_notes_with_form.html.haml
+++ b/app/views/projects/notes/_notes_with_form.html.haml
@@ -20,4 +20,4 @@
to post a comment
:javascript
- var notes = new Notes("#{namespace_project_notes_path(namespace_id: @project.namespace, target_id: @noteable.id, target_type: @noteable.class.name.underscore)}", #{@notes.map(&:id).to_json}, #{Time.now.to_i}, "#{diff_view}")
+ var notes = new Notes("#{namespace_project_notes_path(namespace_id: @project.namespace, project_id: @project, target_id: @noteable.id, target_type: @noteable.class.name.underscore)}", #{@notes.map(&:id).to_json}, #{Time.now.to_i}, "#{diff_view}")
diff --git a/spec/views/projects/merge_requests/show.html.haml_spec.rb b/spec/views/projects/merge_requests/show.html.haml_spec.rb
index 33cabd14913..7f123b15194 100644
--- a/spec/views/projects/merge_requests/show.html.haml_spec.rb
+++ b/spec/views/projects/merge_requests/show.html.haml_spec.rb
@@ -7,6 +7,7 @@ describe 'projects/merge_requests/show.html.haml' do
let(:project) { create(:project) }
let(:fork_project) { create(:project, forked_from_project: project) }
let(:unlink_project) { Projects::UnlinkForkService.new(fork_project, user) }
+ let(:note) { create(:note_on_merge_request, project: project, noteable: closed_merge_request) }
let(:closed_merge_request) do
create(:closed_merge_request,
@@ -19,8 +20,12 @@ describe 'projects/merge_requests/show.html.haml' do
assign(:project, project)
assign(:merge_request, closed_merge_request)
assign(:commits_count, 0)
+ assign(:note, note)
+ assign(:noteable, closed_merge_request)
+ assign(:notes, [])
+ assign(:pipelines, Ci::Pipeline.none)
- allow(view).to receive(:can?).and_return(true)
+ allow(view).to receive_messages(current_user: user, can?: true)
end
context 'when the merge request is closed' do