Last active
August 29, 2015 14:26
-
-
Save duderonomy/cc8225ee7949ffa65dd8 to your computer and use it in GitHub Desktop.
confusing user variable, visit vs. put
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'authorization' do | |
let(:user) { FactoryGirl.create(:user) } | |
describe 'for non-signed-in users' do | |
describe 'in the Users controller' do | |
# describe 'visiting the edit page' do | |
# before { visit edit_user_path(user) } | |
# it { expect(page).to have_title(full_title('Sign in')) } | |
# it { expect(page).to have_selector('div.alert.alert-notice') } | |
# end | |
describe 'submitting to the update action' do | |
before { put user_path(user) } | |
it { expect(response).to redirect_to(login_path) } | |
end | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rspec spec/features/authentication_pages_spec.rb | |
No DRb server is running. Running in local process instead ... | |
F............. | |
Failures: | |
1) Authentication authorization for non-signed-in users in the Users controller submitting to the update action | |
Failure/Error: before { put user_path(user) } | |
ActionController::ParameterMissing: | |
param is missing or the value is empty: user | |
# ./app/controllers/users_controller.rb:46:in `user_params' | |
# ./app/controllers/users_controller.rb:29:in `update' | |
# ./spec/features/authentication_pages_spec.rb:64:in `block (6 levels) in <top (required)>' | |
Finished in 1 second (files took 3.69 seconds to load) | |
14 examples, 1 failure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment