Sha256: 2850ca521463b0deb09c6101ab5d2998f976454c82e9e3aed66250d884bcc901

Contents?: true

Size: 1.16 KB

Versions: 53

Compression:

Stored size: 1.16 KB

Contents

require File.dirname(__FILE__) + '/../test_helper'
require 'users_controller'

# Re-raise errors caught by the controller.
class UsersController; def rescue_action(e) raise e end; end

class UsersControllerTest < Test::Unit::TestCase
  fixtures :all

  def setup
    @controller = UsersController.new
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new
    @user       = User.find(:first)
  end
  
  should_filter_params :ssn

  should_be_restful do |resource|
    resource.identifier = :id
    resource.klass      = User
    resource.object     = :user
    resource.parent     = []
    resource.actions    = [:index, :show, :new, :edit, :update, :create, :destroy]
    resource.formats    = [:html, :xml]

    resource.create.params = { :name => "bob", :email => 'bob@bob.com', :age => 13, :ssn => "123456789"}
    resource.update.params = { :name => "sue" }

    resource.create.redirect  = "user_url(@user)"
    resource.update.redirect  = "user_url(@user)"
    resource.destroy.redirect = "users_url"

    resource.create.flash  = /created/i
    resource.update.flash  = /updated/i
    resource.destroy.flash = /removed/i
  end
end

Version data entries

53 entries across 53 versions & 12 rubygems

Version Path
emschwar-shoulda-2.0.6.1 test/functional/users_controller_test.rb
francois-shoulda-2.0.5.1 test/functional/users_controller_test.rb
francois-shoulda-2.0.5.2 test/functional/users_controller_test.rb
francois-shoulda-2.0.5.4 test/functional/users_controller_test.rb
gsterndale-warrant-0.2.0 test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.6/test/functional/users_controller_test.rb
gsterndale-warrant-0.3.0 test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.6/test/functional/users_controller_test.rb
hashrocket-clearance-0.4.0 test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/functional/users_controller_test.rb
hashrocket-clearance-0.4.1 test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/functional/users_controller_test.rb
hashrocket-clearance-0.4.2 test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/functional/users_controller_test.rb
hashrocket-clearance-0.4.3 test/rails_root/vendor/gems/thoughtbot-shoulda-2.0.4/test/functional/users_controller_test.rb
mattknox-goaloc-0.3.0 lib/goaloc/generators/resources/shoulda/test/functional/users_controller_test.rb
mattknox-goaloc-0.4.0 lib/goaloc/generators/resources/shoulda/test/functional/users_controller_test.rb
mjankowski-shoulda-2.0.4 test/functional/users_controller_test.rb
mjankowski-shoulda-2.0.5 test/functional/users_controller_test.rb
ratnikov-shoulda-2.0.6.1 test/functional/users_controller_test.rb
ratnikov-shoulda-2.0.6.2 test/functional/users_controller_test.rb
ratnikov-shoulda-2.0.6.3 test/functional/users_controller_test.rb
ratnikov-shoulda-2.9.0.1 test/functional/users_controller_test.rb
ratnikov-shoulda-2.9.0.2 test/functional/users_controller_test.rb
ratnikov-shoulda-2.9.0.3 test/functional/users_controller_test.rb