Skip to content

Instantly share code, notes, and snippets.

@enricostano
Created October 10, 2012 12:22
Show Gist options
  • Save enricostano/3865262 to your computer and use it in GitHub Desktop.
Save enricostano/3865262 to your computer and use it in GitHub Desktop.
1) UsersController if the user passes all the authorizations GET #new assigns a new User to @user
Failure/Error: get :new
#<UsersController:0x00000004ed6dc8> received :authorize! with unexpected arguments
expected: (:new, #<User id: nil, email: "", encrypted_password: "", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 0, current_sign_in_at: nil, last_sign_in_at: nil, current_sign_in_ip: nil, last_sign_in_ip: nil, created_at: nil, updated_at: nil, phone: nil, address: nil, city: nil, cap: nil, partitaiva: nil, ragionesociale: nil>)
got: (:new, #<User id: nil, email: "", encrypted_password: "", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 0, current_sign_in_at: nil, last_sign_in_at: nil, current_sign_in_ip: nil, last_sign_in_ip: nil, created_at: nil, updated_at: nil, phone: nil, address: nil, city: nil, cap: nil, partitaiva: nil, ragionesociale: nil>)
# ./spec/controllers/users_controller_spec.rb:45:in `block (4 levels) in <top (required)>'
describe "GET #new" do
before do
@user = User.new
should_authorize(:new, @user)
end
it "assigns a new User to @user" do
get :new
response.should be_success
end
it "populates an array of roles in @roles"
it "renders the :new template"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment