OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/spec/views/projects/settings.html.erb_spec.rb

34 lines
825 B

require 'spec_helper'
describe 'projects/settings', :type => :view do
let(:project) { FactoryGirl.create(:project) }
describe 'project copy permission' do
before do
assign(:project, project)
view.stub(:render_tabs).and_return('')
end
context 'when project copy is allowed' do
before do
allow(project).to receive(:copy_allowed?).and_return(true)
render
end
it 'the copy link should be visible' do
expect(rendered).to have_selector "a.copy"
end
end
context 'when project copy is not allowed' do
before do
allow(project).to receive(:copy_allowed?).and_return(false)
render
end
it 'the copy link should not be visible' do
expect(rendered).to_not have_selector "a.copy"
end
end
end
end