Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## TEST THAT IS FAILING
- context "logged in" do
- before(:all) do
- @user = login(:user)
- @apartment_address_attributes = Factory.attributes_for(:address)
- end
- it "creates a new residence" do
- get "/residences/new"
- response.code.should eq("200")
- page.should have_content("Residence Type") <-- THIS FAILS
- end
- 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"
- ## USER LOGIN METHOD
- def login(type)
- @user = Factory(type)
- visit root_url
- click_on('Login')
- fill_in( 'Email', :with => @user.email )
- fill_in( 'Password', :with => @user.password )
- post sessions_path, :email => @user.email, :password => @user.password
- response.should redirect_to(residences_path)
- follow_redirect!
- response.body.should have_content("Logged in")
- session[:user_id].should eq(@user.id)
- @user
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement