Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixing accounts controller test to meet new should_deny_access_on int…

…erface, changing routes to meet groupies experience.
  • Loading branch information...
commit 0e8d1a6a207faabab79c393a65babe716f094bf1 1 parent 6da73ca
@croaky croaky authored
View
2  config/routes.rb
@@ -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]
View
2  shoulda_macros/clearance.rb
@@ -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
View
5 test/rails_root/test/functional/accounts_controller_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.