rails-4-1-rspec-3-0 icon indicating copy to clipboard operation
rails-4-1-rspec-3-0 copied to clipboard

Code samples for Everyday Rails Testing with RSpec, Rails 4.1/RSpec 3.0 edition

Results 33 rails-4-1-rspec-3-0 issues
Sort by recently updated
recently updated
newest added

When I pull 09_speedup branch for use in Chap 11, `bundle install` didn't succeed. The bundler error suggested "it might be Gemfile.lock corruption" so I removed the file and tried...

Current master, as well as 09_speedup and 11_tdd branch cause the following error when running `bundle` under Ruby 2.1.10 plus rbenv: ``` Your Gemfile.lock is corrupt. The following gem is...

One of my readers reported that selenium-webdriver won't work against Firefox 48 or later even if he updates selenium-webdriver. This problem is related to the issue below: [Firefox driver in...

The following is the error in executing `bundle exec rspec` on 05_controller_basics branch: ``` Failures: 1) ContactsController GET #index without params[:letter] populates an array of all contacts Failure/Error: expect(assigns(:contacts)).to match_array([smith,...

In chapter 5 Testing non-CRUD methods, the test code uses "be_true" but it should be "be_truthy" since RSpec 3.0. At least, RSpec 3.2 will fail like this: ``` ruby example...

``` ruby describe "POST #create" do it "requires login" do post :create, id: create(:contact), contact: attributes_for(:contact) expect(response).to require_login end end ``` should be ``` ruby describe "POST #create" do it...

users_spec uses `find` method: ``` ruby expect{ click_link 'Users' click_link 'New User' fill_in 'Email', with: '[email protected]' find('#password').fill_in 'Password', with: 'secret123' find('#password_confirmation').fill_in 'Password confirmation', with: 'secret123' click_button 'Create User' }.to change(User,...

After the chapter 9, `set_user_session` is not used anymore: https://github.com/everydayrails/rails-4-1-rspec-3-0/compare/08_features...09_speedup However it can be used in users_controller_spec: ``` ruby describe UsersController do describe 'user access' do before :each do @user...

As for contacts_controller_spec.rb, I found many points to be refactored. - Narrow the scope of `let` - Use `let` instead of instance variables for consistency - Delete useless stubbing -...