Ruby on Rails Tuesday, June 3, 2014

Antônio Augusto Sousa Britto wrote in post #1148726:
> You haven't assigned anything to the "user" variable used at line 93
> inside
> the method call "following_user_path"
>
> You coudl try to create an user using factory girl, inside your current
> scope, perhaps using:
> let(:user) { FactoryGirl.create(:user) }
>
> Anyway, I strongly recommend that you refactor this spec in order to
> make
> it DRY and use context blocks in advance of so many describe blocks.

I use following code

before { visitfollowing_user_path(FactoryGirl.create(:user)) }

in place of

before { visit following_user_path(user) } at line 93.

Now test is pass.

Is right way? can I move further in that chapter to implement
sample_app?

Kind regards.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/05e15c04defaca6ef546ecc907df88bb%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment