Skip to content

Commit

Permalink
Use symbols for multi-action tests in ProjectsController
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Aug 6, 2012
1 parent cb35a26 commit b67926f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions spec/controllers/projects_controller_spec.rb
Expand Up @@ -10,15 +10,14 @@
sign_in(:user, user)
end


{ "new" => "get",
"create" => "post",
"edit" => "get",
"update" => "put",
"destroy" => "delete" }.each do |action, method|
{ :new => :get,
:create => :post,
:edit => :get,
:update => :put,
:destroy => :delete }.each do |action, method|
it "cannot access the #{action} action" do
sign_in(:user, user)
send(method, action.dup, :id => project.id)
send(method, action, :id => project.id)
response.should redirect_to(root_path)
flash[:alert].should eql("You must be an admin to do that.")
end
Expand Down

0 comments on commit b67926f

Please sign in to comment.