Tuesday 15 June 2010

ruby - Rspec testing if text is pluralized (Hartl 10.5 Exercise 1) -


Ruby 1.9.3, Rail 3.2.2 I'm trying to write an RPCEC (CAPEBARA) test My page "is multilingual post" right word I get an error when you run your APC that states:

c: /.../ my_app / spec / requests / user_pages_spec. In rb: 58: 'in block (3 level)': For an undefined local variable or 'user' ... (name error)

This is a relevant test:

  description " Profiles page "user) {Factorigrlkkrete (: user)} Come on! (: M1) {FactoryGreat.Scent (: microprost, user: user, content: "food")} Come on! (M-2) {Factorigrlksent (Maikrofost, User_path (user) {user_path (user) before} User Content "bar")} should be ( 'H1', text: Ughrknam)} (must be It must be 'Settle' ('title', text: user name)}} ("all") after {user.delete_all} ("all") {40.times {FactoryGirl.create (: micropost, user: User, content: "food")}}. 'Div.pagination')} end describe "microposts" It (should _content should (m1.content) must) (_content (m2.content)} It should be (_content (user.microposts.count)} sign_in user before the trip Root_path User.delete_all to end it "post numbers should Valuable" Factorigrild to Kcreate (: Maikroprost user: users, content: "the food") page. Chahia_ content ( "1 microphone") 2. Times {FactoryGirl.create (: micropost, user: user, content: "food")} page I should not have to say content ("2 microposts") end   

I'm not sure if I'm going to test correctly for the plural of the post, but I mainly I am stumped in why the blocked users can not see the object after "line", if it can be seen after my statement. If I tell you if the block is all right.

outside E also does not have access to defined variables with code before , , let , etc. You should put it under this call, say a text argument that describes the total / if else test Do you want to include the second code from your question with this question Can update?

No comments:

Post a Comment