Commit f6e5cc3c authored by Rémy Coutable's avatar Rémy Coutable

Add a view spec for projects/notes/_form

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 929ff01a
require 'spec_helper'
describe 'Projects > Commits > Note' do
let(:project) { create(:project) }
let(:commit) { project.commit('7d3b0f7cff5f37573aea97cebfd5692ea1689924') }
before do
login_as :user
project.team << [@user, :master]
visit namespace_project_commit_path(project.namespace, project, commit.id)
end
it 'says that only markdown is supported, not slash commands' do
expect(page).to have_content('Styling with Markdown is supported')
end
end
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment