rspec_rails_4 icon indicating copy to clipboard operation
rspec_rails_4 copied to clipboard

Ch.6, p.70 - How about using "specify" instead of "it"?

Open JunichiIto opened this issue 11 years ago • 2 comments

I prefer to write examples like this:

      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)
        expect(response).to redirect_to root_url
      end

This is because "it GET #new denies access" is grammatically incorrect. "Specify (that) GET #new denies access" sounds natural for me. How about this?

JunichiIto avatar Jan 19 '14 22:01 JunichiIto

Let's revisit this for the RSpec 3 update. I don't really want to redo code samples until then.

ruralocity avatar Jan 20 '14 22:01 ruralocity

I agree. That sounds reasonable.

JunichiIto avatar Jan 21 '14 19:01 JunichiIto