...x86_64 -cdrom filename.iso If you prepared a USB pen drive and want to test it, run it like this (/dev/sdx being your device name; you may need to sudo...
...to config/initializers.rb. In the same initializer, type a line: Undebug.trace_message('foobar') Now run tests or whatever you need to do to to trigger that message. The console output should...
In order to go back one page in your Cucumber tests, you can use the following step definition for Capybara: When(/^I go back$/) do visit page.driver.request.env['HTTP_REFERER']
You can give the agent a way to verify its own work (e.g. tests, a build, a screenshot) and explain why "looks done" is not done.
...and the agent work out the whole plan first — files involved, approach, edge cases, tests, what's out of scope — for example with the /agree-on-everything skill or by letting the...
...authorized users only 3. Using the same storage folder for multiple Rails environments or test processes This one affects your developers. If an image with ID 4 always ends up...
...as public/system/images/4.jpg, multiple Rails environments (e.g. development and test) will randomly see and overwrite each other's files. See Always store your Paperclip attachments in a separate folder per environment...
...scrollbars ? '==' : '!=' scroll_height.should.send(comparison, offset_height) end This should respect padding. However, I have not tested if margins have an effect on it...
The linked site hosts a simple test. It shows two images with narrow vertical/horizontal lines. The more they resemble each other, the more Retina your display is...
...the usual notification rules, i.e. you won't get anything in the development or test environments. Obiously, this only works with tasks that actually depend on :environment...
...so it should be a drop-in replacement for all your projects. For Rack::Test the step no longer uses XPath so you should be able to understand it when...
RSpec 1 (Rails 2) With the most recent spec_candy.rb helpers you can say: User.stub_any_instance(:foo => :bar) user = User.new...
In most of our applications, users have their first and last name stored in separate columns. However, specifying them separately...
...can structure specs with nested example groups, let, subject and before/after hooks, and share tests between similar classes with shared example groups. You can explain the trade-off between DRY...
...extracted into shared helpers instead of copied. You can explain what mocking is, use test doubles to take control of a collaborator, and name a case where a mocked test...
Updated the card with our current best practice (shared app code and specs via symlinks).
Sometimes you need to look at the filter chain in specs. You can do it like that on Rails 2...
In the tradition of our PostgreSQL cheat sheet for MySQL lamers, here is a cheat sheet for Jasmine when you...
...implement sending an error notification if the data (in the db) is too old. Testing: If you use sidekiq_retries_exhausted (unit test): https://stackoverflow.com/questions/33930199/rspec-sidekiq-how-to-test-within-sidekiq-retries-exhausted-block-with-another If you use the...
...global option (manual test): # Use this worker to test if the exception notifier for sidekiq works as expected and the retries total duration fits. # Example: TestWorker.perform_async('foo', 'bar')
...pack is application.js): = image_pack_tag('media/application/images/logo.png') Deployment Follow Configuring Webpacker deployments with Capistrano. Tests In your cucumber test, you will want to regenerate your assets before each test suite...
...run. Since this is a bit slow, especially when using multiple processes with parallel_test, read this card. jQuery If you still require jQuery, add it to your webpacker project...
...servers. It spins up when you run your feature specs, so that you can test your purchase flow without hitting Stripe’s servers or making any external HTTP requests.
...ve also had tests actually hitting the testing sandbox of Stripe, which worked OK most of the time (can be flakey...
...the following command open a database console for the development environment: rails dbconsole -p test You need to write this instead: rails dbconsole test -p
So you can easily add new roles to a user model and start testing without adding new traits by yourself. Note: If you not provide a second argument to...
I recently encountered the error above when I was running selenium tests. Thanks to a post on stackoverflow I found out that clearing all files in tmp/cache in my project...
Sometimes you want to test migrations with production or staging data. Dumping single tables makes sense if a complete dump would be to big. mysqldump -u deploy_user -p application...
.../public/assets-test/', '/tmp/', ] } 2. Report all existing offenses and exclude them initially Add an RSpec test, which runs ESLint (also during a full RSpec test run), e.g. in spec/eslint_spec.rb: require 'open3...
expect(status.success?).to eq(true), failure_message end end Run the test or simply run yarn run eslint . from your console to check all files. Now you...
To test that an object was constructed by a given constructor function, use jasmine.any(Klass): describe('plus()', function() { it ('returns a number', function() { let result = plus(1, 2) expect(result...