...server from time to time. Before doing a full deploy, you might want to test that server in an isolated deploy. There is a single way to do this: the...
...run for servers matching {:roles=> }, but no servers matched. Instead, specify the server-under-test like this: HOSTFILTER=separate-sidekiq.makandra.de cap production deploy Capistrano is aware of this env variable and...
...silence some specific warnings. Add this to your initializers, or require it in your tests: silenced = [ /Not considered a useful test/, /use: should(_not)? have_sent_email/, ] # list of warnings...
...if you make any error in programming. E.g. a simple typo would make the test above green. The block will catch the Spec:: exception and the test will be happy...
Custom matchers are a useful RSpec feature which you can use to DRY up repetitive expectations in your specs. Unfortunately...
Testing with real live production data does come with at least one catch. All those real live users in your production environment have real live email addresses that receive real...
...and check if your application responds and everything looks okay. Run your application's tests...
...Find descendant(s) by CSS selector .find(selector) one: .querySelector(selector), many: .querySelectorAll(selector) Test an element (returns boolean) .is(selector) .matches(selector) Test for class presence (boolean) .hasClass(class...
...files from the dist folder, which is most often <ES6 javascript. 9. Achieve green tests. 10. Check if postcss, uglifier, babel and other compilers work for production. This can be...
.replace(/^/, '#') Ruby My use case was comparing colors in an integration test, so I used JS to get the pseudo element's style via Selenium, and then processed it...
...Here is how to circumvent that. What's going on? You are making ActionController::TestRequests in your specs, and their #initialize method does this: self.session = TestSession.new This means that each...
...behavior by stubbing the controller's session and querying that stub: persisted_session = ActionController::TestSession.new controller.stub :session => persisted_session # do things persisted_session[:something].should ... Apply this workaround only when...
PostgreSQL supports the SQL OVERLAPS operator. You can use it to test if two date ranges overlap: => SELECT ('2001-02-16'::date, '2001-12-21'::date) OVERLAPS...
...date, '2002-10-30'::date); overlaps -------- false Also compare our card Test if two date ranges overlap in Ruby or Rails...
...want to use it in production, but it may serve you well for some testing/prototyping/etc...
require 'spreadsheet' Spreadsheet.client_encoding = 'UTF-8' book = Spreadsheet::Workbook.new sheet1 = book.create_worksheet :name => 'test' money_format = Spreadsheet::Format.new :number_format => "#,##0.00 [$€-407]" date_format = Spreadsheet::Format.new :number_format => 'DD.MM.YYYY...
...sheet1.column(2).default_format = date_format sheet1.row(0).push "just text", 5.98, DateTime.now book.write 'test.xls' That's how to insert Links into a excel cell book = Spreadsheet::Workbook.new sheet1 = book.create...
Shared example groups are a useful RSpec feature. Unfortunately the default directory structure generated by rspec-rails has no obvious...
...SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=unknown state SSL Server Test This SSL Server Test can help finding out which SSL/TLS versions the server can handle...
...rails generate cucumber:install --capybara to integrate cucumber/capybara into your rails project. Run your tests and fix error messages by reintegrating parts from your backed up files...
Then the "sorted" select should be sorted But the "unsorted" select should not be sorted
How to call routes, make requests and try out helpers from the Rails console.
You can chain multiple Capybara matchers on the page or any element: expect(page) .to have_content('Example Course')
VCR.use_cassette(' ', match_requests_on: %i[method oauth_uri]) do # Your test here
...is not used before removing it. If you remove the --dry-run flag, all tests will actually run and you can skip adding the require_relative line. It will take...
...Upgrade spreewald: bundle update spreewald Upgrade cucumber_factory: bundle update cucumber_factory Upgrade parallel_tests: bundle update parallel_tests Even on the latest version, parallel_tests will print some deprecation...
...page will show up in your browser. Note that if you run your Cucumber tests using the cuc script from our geordi gem, it will automatically detect cucumber_spinner and...
The pages […] allow you to see different types of mixed content and test how they behave in your browser. The "Secure" pages are referencing assets with HTTPS, the "Non-Secure...
...same behavior with both Secure pages and the Secure HTTP page for a given test; the behavior will change on the Non-Secure HTTPS page. Also see Testing HTTPS with...