Skip to content

Commit

Permalink
fixing accounts controller test to meet new should_deny_access_on int…
Browse files Browse the repository at this point in the history
…erface, changing routes to meet groupies experience.
  • Loading branch information
Dan Croak committed Apr 2, 2009
1 parent 6da73ca commit 0e8d1a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
:controller => 'clearance/sessions',
:only => [:new, :create, :destroy]

map.resources :users, :controller => 'clearance/users' do |users|
map.resources :users do |users|
users.resource :password,
:controller => 'clearance/passwords',
:only => [:create, :edit, :update]
Expand Down
2 changes: 1 addition & 1 deletion shoulda_macros/clearance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def should_not_be_signed_in
# Examples:
# should_deny_access_on :get, :index, :flash => /not authorized/i
# should_deny_access_on :get, :show, :id => '1'
def self.should_deny_access_on(http_method, action, opts = {})
def should_deny_access_on(http_method, action, opts = {})
flash_message = opts.delete(:flash)
context "on #{http_method} to #{action}" do
setup do
Expand Down
5 changes: 3 additions & 2 deletions test/rails_root/test/functional/accounts_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
require 'test_helper'

class AccountsControllerTest < ActionController::TestCase

public_context do
should_deny_access_on 'get :edit'
should_deny_access_on 'put :update'
should_deny_access_on :get, :edit
should_deny_access_on :put, :update
end

context "on POST to create" do
Expand Down

0 comments on commit 0e8d1a6

Please sign in to comment.