...the test database. NoMethodError: undefined method 'last_comment' for # Rake 11 removes a method that rspec-core < 3.4.4 depends on. To fix, lock Rake to < 11 in your Gemfile:
...rake', '< 11', # Removes a method that rspec-core < 3.4 depends on
...file_fixture is not available by default. To enable it, include a support module from rspec-rails: FactoryBot::SyntaxRunner.include(RSpec::Rails::FileFixtureSupport) That includes ActiveSupport::Testing::FileFixtures, where file_fixture...
Show failing specs instantly. Show passing spec as green dots as usual. Configuration: # spec/spec.opts (.rspec for rspec 2) --require rspec/instafail --format RSpec::Instafail
...executable-flags from files that should not be executable geordi rs[pec] [FILES] # Run RSpec geordi sec[urity-update] [STEP] # Support for performing security updates geordi set[up] # Setup a...
...Rubymine if you need to do so. Debugging in your tests When you run RSpec or Cucumber, Ruby is already in debug mode. Tests will open a debugging shell when...
...Temporarily change the current power When you set Power.current to a power in an RSpec example, you must remember to nilify it afterwards. Otherwise other examples will see your global...
Our awesome collection of rspec helpers (formerly known as "spec_candy.rb") is now available as a gem. It works, it is tested and there will be updates. Usage Add rspec_candy...
...to your Gemfile. Add require 'rspec_candy/helpers' to your spec_helper.rb, after the rspec requires. List of features
...and re-create your test database before each run of your test suite. Configure RSpec to wrap each example in a transaction that is rolled back when the example ends...
...Then I should get a download with filename "..." expected: /filename="some.pdf"$/ got: nil (using =~) (RSpec::Expectations::ExpectationNotMetError) Solution One solution is to check the Content-Type header only with the...
...of this. See How to set up database_cleaner for Rails with Cucumber and RSpec...
...Chrome, you can spawn a new Chrome using the --user-agent command line switch. RSpec In controller specs, you can just modify the Rack environment before making your request:
...own Gemfile for each Rails app, which freezes the correct versions of Rails and RSpec and referencing the gem itself. Shared specs live in spec/shared/library_name. A Rakefile in the project...
...backported functionality from modern Rubies Migrating from require to require_relative where I loaded RSpec factories in Cucumber's env.rb (the Rails application root is no longer in the load...
Webmocks hash_including is similar to RSpec::Mocks::ArgumentMatchers#hash_including. Be aware that hash_including (webmock v3.0.1) doesn't parse integer values to String. Without hash including you would...
...installation guide: # Gemfile gem 'shoulda-matchers', require: false # spec/rails_helper.rb if present, spec/spec_helper.rb else require 'rspec/rails' require 'shoulda/matchers...
...the runtime of different strategies using an average-sized Rails project (with MySQL): Cucumber RSpec Transaction 87.14, 86.65 10.20, 10.11 Truncation 90.43, 90.69 26.82, 26.46
Improve geordi tests: If rake runs tests, skip other test runs (cucumber, rspec), as rake usually runs all employed tests Rename geordi devserver to geordi server (the former...
...the block, Project.make will only run once when the blueprint is parsed (usually when RSpec is loaded), which is not what you want...
...put it into config/initializers/ to make those warnings go away. Since we're using RSpec on most projects, I've transformed the test for it to a spec. See the...
If you use rails_admin, your specs pass with the rspec binary, but not using rake spec (or rake parallel:spec etc), put this at the top of your spec...
Spreewald 1.1.0 drops the be_true and be_false matchers in order to be RSpec 3 and Ruby 2 compatible. For backward compatibility, these matchers are replaced with == true and...
When using TextMate2 with the cucumber bundle, it does not recognize step definitions (e.g. custom_steps.rb) as such but believes they...
.../customer-2/https:\/\/gitlab-ci-token:$CI_CUSTOMER_2_ACCESS_TOKEN@code.example.com\/dev\/customer-2.git/" .gitmodules - git submodule init - git submodule update - bundle install rspec: script: - bundle exec rake db:create db:migrate - bundle exec rspec This approach requires you...
...and should be used appropriately based on the situation. The majority of examples on rspec's story runner currently on the web, including mine, are of the imperative type. Since...