ruby on rails - Capybara issues with request specs using Devise -
here request spec:
require 'spec_helper' describe "user signs in", focus: true before(:each) create(:account_type) end "allows users sign in email address , password" test_user = build_stubbed(:user) visit root_path click_link "sign-in" fill_in "user_email", with: test_user.email fill_in "user_password", with: test_user.password click_button "sign in" page.should have_content "vitals" end end the issue can see request happen log user in, when user logged in, request redirected home page without error message.
here user factory:
factorygirl.define factory :user email faker::internet.email password "password" password_confirmation "password" agreed_to_age_requirements true subscriptions {[create(:subscription)]} end end subscriptions factory:
factorygirl.define factory :subscription account_type_id 1 trial_expiry 30.days.from_now active true end end i not sure why request failing , not signing-in user.
Comments
Post a Comment