I use Rspec Rails with Capybara for testing, and I want to use the new specification in RSpec Rails 3, because they are read more as customer tests and acceptance tests, however, one thing that I think is missing in the older style (Describe / Not) is nesting . When I try to nest scenariosor use backgroundinside any block scenario, I get an error undefined method. Anyway, I could get an attachment with specification functions to get something like this (from Michael Hartl Ruby On Rails Tutorial :
read more as customer tests and acceptance tests
scenarios
background
scenario
undefined method
describe "Authentication" do subject { page } describe "authorization" do let(:user) { FactoryGirl.create(:user) } describe "for non-signed in users" do describe "when attempting to visit a protected page" do before { visit edit_user_path(user) } it "should redirect_to to the signin page" do expect(page).to have_title('Sign in') end describe "after signing in" do before do valid_signin user, no_visit: true end it "should render the desired protected page" do expect(page).to have_title('Edit user') end
Or should I think differently about integration tests?
https://www.relishapp.com/rspec/rspec-rails/docs/feature-specs/feature-spec, feature describe, scenario it. , feature, scenario scenario, , it it.
feature
describe
it
feature scenarios Capybara version 2.2.1
Capybara version 2.2.1
Gemfile
gem "capybara", "~> 2.2.1"
bundle install
Capybara
...,: type = > : feature, - , /* !* let/* let! * .
, 2.2.1
Source: https://habr.com/ru/post/1532218/More articles:Is there a way to change the height of a UITableView from a custom UITableViewCell class? - iosMoose, how to change the attribute value only when it is equal to $ undef? - perlPython is equivalent to a system ("PAUSE") - pythonRewrite or change routing in asp.net MVC url? - restкак получить дату фиксации с помощью octokit.rb - githubShrink Panel Width to Content Width - twitter-bootstrapUnable to change SKPhysicsJointLimit maxLength after adding a connection to SKPhysicsWorld in Sprite Kit - sprite-kitAutoMapper Project(). Для и многократных лямбда-выражений - c#Save download statistics / log - command-lineMake JavaScript code (with selenium) survive page reload - javascriptAll Articles