rosa-build/spec/support/shared_examples/projects_controller.rb

24 lines
802 B
Ruby

# -*- encoding : utf-8 -*-
shared_examples_for 'projects user with reader rights' do
it_should_behave_like 'user with rights to view projects'
it 'should be able to fork project' do
post :fork, :owner_name => @project.owner.uname, :project_name => @project.name
response.should redirect_to(project_path(Project.last))
end
end
shared_examples_for 'projects user with admin rights' do
it 'should be able to perform update action' do
put :update, {:owner_name => @project.owner.uname, :project_name => @project.name}.merge(@update_params)
response.should redirect_to(project_path(@project))
end
end
shared_examples_for 'user with rights to view projects' do
it 'should be able to perform index action' do
get :index
response.should render_template(:index)
end
end