config.before(:suite) { puts 'BEFORE :suite' } config.after(:suite) { puts 'AFTER :suite' } end describe 'order of hook execution' do around(:all) do |each| puts 'AROUND BEFORE :all' each.run puts 'AROUND...
When you call a method on an object, Ruby looks for the implementation of that method. It looks in the...
Rails 3, 4, 5, 6 config/application.rb config/environment.rb before the initialize! call (we don't usually edit this file)
There is no such thing as a "default order" of rows in database tables. For instance, when you paginate a result set: When using LIMIT, it is important to use...
...an ORDER BY clause that constrains the result rows into a unique order. Otherwise you will get an unpredictable subset of the query's rows. You might be asking for...
...examples should not change global state, you should not need to care about the order in which RSpec processes your .rb files. However, in some cases you might want to...
RSpec 3 Runs .rb files in alphabetical order of their file paths by default (or when you specify --order defined). You run tests in random order by using --order...
require filename end However, this causes files to be required in an order determined by the file system. Since load order can be important, this may lead to...
In CI test runs I noticed that string sorting order changed after switching from a debian-based PostgreSQL docker image to one that is based on Alpine Linux.
...installed and does not use all locales that a user installs by default. Postgres orders string columns based on the collation of the databse (LC_ALL or LC_COLLATE). On...
You can use ordered to ensure that messages are received in a specific order. Example expect(ClassA).to receive(:call_first).ordered expect(ClassB).to receive(:call_second...
expect(ClassB).to receive(:call_third).ordered #ordered supports further chaining
Around will not happen until after a feature's Background has been processed. Use Before and After to avoid that...
How you order elements in the can have an effect on the (perceived) performance of the page. This script helps you identify which elements are out of order. Also available...
...as a Chrome Extension. It shows the actual order of head elements, and suggests an optimal order for page performance...
...element when sliding, being rendered as frontmost element. After the slider has settled, stacking order jumps back to normal. It seems like Chrome is doing its compositing wrong. This doesn...
...to be the topmost item on small screens. You'll need to invert the order of list items, but only for large screens. Here are some approaches to do so...
before transition before validation after validation before save after save after transition Aborting the callback chain See Cancel the ActiveRecord...
...you also get qualified column names (created_at becomes images.created_at) for free. Multiple order criteria To add secondary order criteria, use a hash with multiple keys and :asc / :desc...
Even when you're using bundler, it might be significant in which order your gems are listed in your Gemfile. This can happen when gems are running around calling require...
...id FROM users WHERE (users.id IN (899,1084,1095,100,2424,2429,2420)) the order of the returned records is undefined. To force the query to return the records in...
...a given order, you have to add ORDER BY FIELD(id, 899, 1084, ...) So the query looks like this: SELECT id FROM users WHERE (users.id IN...
Sometimes the order in which strings appear on a page matters to you. Spreewald gives you steps like these: Then I should see in this order: | Alpha Group | | Augsburg |
Or, if you prefer multiline strings: Then I should see in this order: """ Alpha Group Augsburg Berlin Beta Group """ The step ignores all HTML tags and only tests...
jamesgolick / resource_controller at Github module ResourceController module Actions def index load_collection before :index response_for :index end
...in matcher in RSpec to check if a string contains terms in the desired order. A simple workaround is to use a regular expression that also matches newlines (m-modifier...
...which needs manually action to be understood (Search if terms appear and in which order) Example: expect(ActionMailer::Base.last.to_s).to match(/Dear customer.*Account canceled.*You Awesome Company/m...
This extension allows you to manually sort (order) your folders in the folder pane of Thunderbird or automatically sort them, but in a better way. This extension also allows you...
...to re-order accounts in the folder pane...
Generally for nested forms, a blank form is placed below all other existing object forms. If you would like to...
If you have several submit elements (inputs or buttons with type="submit") that each cause different things to happen (e.g...
Take care when using rescue_from to rescue multiple errors. The following will not work, because later rescue_from statements...
Use reorder to replace an existing order clause with a new expression...