diff options
author | Rémy Coutable <remy@rymai.me> | 2016-09-20 10:45:00 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-09-20 13:58:14 +0200 |
commit | f6e5cc3c37f83044ca06d82aacf8ccb2796df724 (patch) | |
tree | 8a0e11ee7670f5d37e2c15f7b413eb98df942835 /spec/views/projects/notes | |
parent | 929ff01ac08db320402c31bb70b463007d1b379d (diff) | |
download | gitlab-ce-f6e5cc3c37f83044ca06d82aacf8ccb2796df724.tar.gz |
Add a view spec for projects/notes/_form
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/views/projects/notes')
-rw-r--r-- | spec/views/projects/notes/_form.html.haml_spec.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/views/projects/notes/_form.html.haml_spec.rb b/spec/views/projects/notes/_form.html.haml_spec.rb new file mode 100644 index 00000000000..932d6756ad2 --- /dev/null +++ b/spec/views/projects/notes/_form.html.haml_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +describe 'projects/notes/_form' do + include Devise::TestHelpers + + let(:user) { create(:user) } + let(:project) { create(:empty_project) } + + before do + project.team << [user, :master] + assign(:project, project) + assign(:note, note) + + allow(view).to receive(:current_user).and_return(user) + + render + end + + %w[issue merge_request].each do |noteable| + context "with a note on #{noteable}" do + let(:note) { build(:"note_on_#{noteable}", project: project) } + + it 'says that only markdown is supported, not slash commands' do + expect(rendered).to have_content('Styling with Markdown and slash commands are supported') + end + end + end + + context 'with a note on a commit' do + let(:note) { build(:note_on_commit, project: project) } + + it 'says that only markdown is supported, not slash commands' do + expect(rendered).to have_content('Styling with Markdown is supported') + end + end +end |