Unable to setup Rspec & Capybara in Rails 3.2

后端 未结 4 510
旧巷少年郎
旧巷少年郎 2021-01-13 10:55

I am creating a sample application for rspec testing, and I followed the below steps In Gemfile:

gem \"rspec-rails\", :group => [:test, :         


        
4条回答
  •  一向
    一向 (楼主)
    2021-01-13 11:30

    Its worth checking out the new Capybara DSL for integration tests (note the features directory):

    # spec/features/user_list_spec.rb
    require 'spec_helper'
    
    feature 'User list' do
      scenario 'List all users' do
        visit users_path
        expect(page).to have_content 'List Users'
      end
    end
    

    I wrote a blog post with some detailed information on End-to-end testing with RSpec integration tests and Capybara using RSpec 2.0 expect syntax, along with Capybara DSL for feature/scenarios.

提交回复
热议问题