gitlab-org--gitlab-foss/spec/views/shared/notes/_form.html.haml_spec.rb

37 lines
943 B
Ruby
Raw Normal View History

require 'spec_helper'
2017-05-03 04:48:01 -04:00
describe 'shared/notes/_form' do
include Devise::Test::ControllerHelpers
let(:user) { create(:user) }
2017-04-07 11:33:48 -04:00
let(:project) { create(:project, :repository) }
before do
project.add_maintainer(user)
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 markdown and quick actions are supported' do
expect(rendered).to have_content('Markdown and quick actions 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 quick actions' do
2017-02-13 09:36:24 -05:00
expect(rendered).to have_content('Markdown is supported')
end
end
end