gitlab-org--gitlab-foss/spec/views/projects/notes/_form.html.haml_spec.rb
Connor Shea 8062380f60 Upgrade Devise from 4.1.1 to 4.2.0.
This fixes an issue with Rails 5 and brings us up-to-date with the latest Devise release.

This also replaces the deprecated Devise::TestHelpers with Devise::Test::ControllerHelpers.

Changelog: https://github.com/plataformatec/devise/blob/v4.2.0/CHANGELOG.md#420---2016-07-01
2016-09-27 20:08:49 -06:00

36 lines
975 B
Ruby

require 'spec_helper'
describe 'projects/notes/_form' do
include Devise::Test::ControllerHelpers
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