samedi 14 février 2015

ember-cli/rails capybara/rspec testing

I'm trying to set up my ember-cli / rails app with integration testing. After fussing with Ember's built in testing library, I've switched over to using RSpec (which I was using for backend anyway), and Capybara. While I can finally fill in forms correctly, my post request to sign_in always fails. I think the issue is Capybara is posting the request to a different database environment or something! If I check at the rails console, the user is certainly there, and I create a user as part of the RSpec test anyway.


Has anyone managed to set up Ember/Rails/Capybara/RSpec?


This is my spec:


describe "the signin process", :type => :feature, :js => true do it "signs me in" do visit '/' FactoryGirl.create :user, email: "user@example.com", password: 'password' within("#tufts-nav") do fill_in 'email', :with => 'test@test.com' fill_in 'password', :with => 'password' end click_button 'Sign In' # here authentication fails mysteriously expect(page).to have_content 'Jobs' end end


Aucun commentaire:

Enregistrer un commentaire