...follow this workflow. Finishing a feature When you're done with your feature and tests are green, and your changes pass our merge request checklist: Within your feature branch, merge...

If a project ist configured to spawn CI runners for tests or deployment when pushing to the Repo, a habit of pushing WIP commits regularly may conflict with that.

...trashed_changed? end Or, move the conditions into the callback. This also allows you test the conditions more easily using a unit test: after_save :update_offices_people_count

if office_id_changed? || trashed_changed? ... end end Also see the card on testing conditional validations...

...serve requests with the HOST header hacker.xyz You need to take care in your tests, that you reset ActionMailer::Base.default_url_options after e.g. request specs, e.g. spec/support/action_mailer.rb: RSpec.configure do...

...main').search('horizon').where('year > 1995').order(:year).to_a Adapt both the integration test and RSpec examples for the search functionality, using the guidelines from the "Testing" chapter in...

...Growing Rails Applications in Practice. RSpec examples should cover all edge cases E2E tests should only cover one "happy path" to show successful integration Open budgets in Project Hero (makandra...

DevOps Curriculum

...number of words, lines and paragraphs, and outputs the result. For example: $ ruby count_words.rb test.txt test.txt has 123 words test.txt has 13 lines test.txt has 4 paragraphs Hint

...verification") added without_partial_double_verification. This might be handy in case you are testing helpers in Rails, where you sometimes rely on methods defined in the application controller (e.g...

...module UsersHelper def user_display_name [current_user.first_name, current_user.last_name].join(' ') end end Unit test with error describe UsersHelper do describe '#user_display_name' do it 'returns the first and...

...instead reference another part of that email by a content ID cid:xxxxx@xxxxx.mail. Your tests will not be able to verify easily that you used the correct image version any...

...last point, it is recommended to use a feature flag and disable inlining in tests by default so you will still be able to easily test that your emails use...

Your development machine is usually on a very good network connection. To test how your application behaves on a slow network (e.g. mobile), you can simulate limited bandwidth. Chrome

SMTP validation: connects to the host received from DNS and starts a test delivery to find out if the recipient mailbox actually exists tl;dr: We suggest you...

...change this attribute to hold a list of URLs, and need to adjust all tests. Our goal is to convert the url "..." to the urls ["..."] here. Open find and replace...

...and expected constants are resolved: class_name = params[:type].presence_in(%w[User Post Test]) if class_name class_name.safe_constantize.new # either User, Post or Test else Rails.logger.error "This should not happen...

This rule needs to be adapted to your setup and needs to be tested before it's activated. Activating lifecycle rules can instantly delete images from registries.

"tagStatus": "tagged", "countType": "sinceImagePushed", "countUnit": "days", "countNumber": 10 }, "action": { "type": "expire" } } ] } Careful when testing Testing these rules is a little confusing because of the wording in the AWS console...

Sometimes you just want to have a small web server that serves files to test something. Serve the current directory On Ruby 1.9.2+ you can do the following ("." for current...

...geordi png-optimize Carrierwave Go through our Carrierwave checklist if used. Maintenance Integrate and test the capistrano maintenance task. Accessibility Decide what effort you want to put in improving accessibility...

...Our first implementation might look like this: def group(content) " #{content} " end We run tests and realize that our helper escapes too much. Content appears like this:

...single feature/spec: Just paste the reference into your terminal (you need to "unmark" the test directories "as test sources root" to get a path relative to the project root).

baz: "example" We can now load it as usual, but pass freeze: true. >> test = YAML.safe_load_file('example.yml', freeze: true) => {"message"=>["hello", "universe"], "foo"=>{"bar"=>{"baz"=>"example"}}}

...itself is frozen: >> test.frozen? => true And no matter how deep you dig, everything inside that Hash is also frozen. >> test['message'].frozen? => true >> test['foo']['bar']['baz'].frozen? => true

semaphoreci.com

In this article, we’ll look at what side effects are, why they are problematic despite being necessary, and how...

github.com

...app such as PHP, Perl, Java / JEE, etc. I like using cucumber for functional testing so I put together this project structure to use as a starting point for testing...

jqueryElement.is(':checked')

freelancefolder.com

...this article we’ve listed 7 fresh and simple tools for cross-browser compatibility testing, tools that actually make this stuff pretty easy. Not only that, but every single one...

celerity.rubyforge.org

Celerity is a JRuby wrapper around HtmlUnit – a headless Java browser with JavaScript support. It provides a simple API for...