rspec_rails_4
rspec_rails_4 copied to clipboard
Everyday Rails Testing with RSpec (Rails 4.0 Edition)
I think the title "Keep it simple" does not represent the content. I expected a story like "Keep your specs simple, complexity is evil", but it wasn't. I thought the...
In Shoulda section, there is the following code: ``` ruby specify { should validate_presence_of :firstname } ``` But in this case, I think `it { should validate_presence_of :firstname }` is...
In p60, `describe "PATCH hide_contact" do` should be `describe "PATCH #hide_contact" do` like other specs.
``` ruby # Set config.use_transactional_fixtures to false config.use_transactional_fixtures = false ``` This comment does not give any information. I recommend to remove it or replace with other useful comment.
This might be a matter of personal preference but `shared_examples("public access to contacts") do` looks a little odd for me. I feel no ( ) style is more popular: E.g....
This code example on page 67 should just be the previous spec code (from chapter 5) surrounded by a describe block that logs in as admin. However, the spec code...
I had to update selenium-webdriver to run specs against Firefox 26. ``` Gemfile gem "selenium-webdriver", "~> 2.39.0" ``` Without this, Firefox and RSpec completely stops after starting up Firefox. The...
I prefer to write examples like this: ``` ruby specify "GET #new denies access" do get :new expect(response).to redirect_to root_url end specify "POST#create denies access" do post :create, user: attributes_for(:user)...
"POST#create" should be "POST #create" like GET examples: ``` describe 'GET #index' do it "GET #new denies access" do it "POST#create denies access" do ```
On page 39, line 5 we have the following: > So far, if we wanted to specify a non-home phone in a spec we've done it like this:[code example follows]...