Can I use before :all with capybara?

前端 未结 1 1580
耶瑟儿~
耶瑟儿~ 2021-01-05 17:33

I have a describe block like this:

describe \"Documents\" do
  subject { page }
  let (:course) { FactoryGirl.create(:course) }
  describe \"new\" do
    be         


        
相关标签:
1条回答
  • 2021-01-05 17:48

    Capybara resets session after each example run, so when you moved visit new_course_document_path(course) into before (:all) block, you had nothing to visit starting from a second example.

    I would recommend to run only that tests you're working on. This could be achieved with a RSpec tag option or guard-rspec, and it'll save you a LOT of time.

    0 讨论(0)
提交回复
热议问题