2019-10-08 08:06:01 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-09-20 04:45:00 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 11:08:50 -04:00
|
|
|
RSpec.describe 'shared/notes/_form' do
|
2016-09-21 19:06:33 -04:00
|
|
|
include Devise::Test::ControllerHelpers
|
2016-09-20 04:45:00 -04:00
|
|
|
|
|
|
|
let(:user) { create(:user) }
|
2017-04-07 11:33:48 -04:00
|
|
|
let(:project) { create(:project, :repository) }
|
2016-09-20 04:45:00 -04:00
|
|
|
|
|
|
|
before do
|
2018-07-11 10:36:08 -04:00
|
|
|
project.add_maintainer(user)
|
2016-09-20 04:45:00 -04:00
|
|
|
assign(:project, project)
|
|
|
|
assign(:note, note)
|
|
|
|
|
|
|
|
allow(view).to receive(:current_user).and_return(user)
|
|
|
|
|
|
|
|
render
|
|
|
|
end
|
|
|
|
|
2018-07-21 07:22:03 -04:00
|
|
|
%w[issue merge_request commit].each do |noteable|
|
2016-09-20 04:45:00 -04:00
|
|
|
context "with a note on #{noteable}" do
|
|
|
|
let(:note) { build(:"note_on_#{noteable}", project: project) }
|
|
|
|
|
2017-05-31 01:50:53 -04:00
|
|
|
it 'says that markdown and quick actions are supported' do
|
|
|
|
expect(rendered).to have_content('Markdown and quick actions are supported')
|
2016-09-20 04:45:00 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|