Advertisement
Guest User

Untitled

a guest
Sep 30th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. ## TEST THAT IS FAILING
  2.  
  3. context "logged in" do
  4. before(:all) do
  5. @user = login(:user)
  6. @apartment_address_attributes = Factory.attributes_for(:address)
  7. end
  8.  
  9. it "creates a new residence" do
  10. get "/residences/new"
  11. response.code.should eq("200")
  12. page.should have_content("Residence Type") <-- THIS FAILS
  13. end
  14.  
  15. ERROR :expected there to be content "Residence Type" in "MyOldPlace\n\n Register ||\n Login\n\n\n\n\n\t\n\t\tEmail\n\t\t\n\t\n\t\tPassword\n\t\t\n\t\n\t\t\n\n\n"
  16.  
  17. ## USER LOGIN METHOD
  18. def login(type)
  19. @user = Factory(type)
  20. visit root_url
  21. click_on('Login')
  22. fill_in( 'Email', :with => @user.email )
  23. fill_in( 'Password', :with => @user.password )
  24. post sessions_path, :email => @user.email, :password => @user.password
  25. response.should redirect_to(residences_path)
  26. follow_redirect!
  27. response.body.should have_content("Logged in")
  28. session[:user_id].should eq(@user.id)
  29. @user
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement