2019-12-21 20:55:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-09-29 09:46:39 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe 'shared/notes/_form' do
|
2016-11-03 12:29:30 +05:30
|
|
|
include Devise::Test::ControllerHelpers
|
2016-09-29 09:46:39 +05:30
|
|
|
|
|
|
|
let(:user) { create(:user) }
|
2017-08-17 22:00:37 +05:30
|
|
|
let(:project) { create(:project, :repository) }
|
2016-09-29 09:46:39 +05:30
|
|
|
|
|
|
|
before do
|
2018-11-18 11:00:15 +05:30
|
|
|
project.add_maintainer(user)
|
2016-09-29 09:46:39 +05:30
|
|
|
assign(:project, project)
|
|
|
|
assign(:note, note)
|
|
|
|
|
|
|
|
allow(view).to receive(:current_user).and_return(user)
|
|
|
|
|
|
|
|
render
|
|
|
|
end
|
|
|
|
|
2018-11-20 20:47:30 +05:30
|
|
|
%w[issue merge_request commit].each do |noteable|
|
2016-09-29 09:46:39 +05:30
|
|
|
context "with a note on #{noteable}" do
|
|
|
|
let(:note) { build(:"note_on_#{noteable}", project: project) }
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
it 'says that markdown and quick actions are supported' do
|
2022-07-16 23:28:13 +05:30
|
|
|
expect(rendered).to have_content('Supports Markdown. For quick actions, type /.')
|
2016-09-29 09:46:39 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|