Authentication is a special part of web applications. On the one hand, it usually is a crucial security mechanism restrict...
RSpec let's you chain a matcher with .or. The expectation will then pass if at least one matcher matches...
There is a kinda secret, yet well supported CSS feature called currentColor. It's like a special CSS variable that...
A matcher is a function that returns an object with a compare key. Usually it is registered with beforeEach...
For outputting a given String in HTML, you mostly want to replace line breaks with or tags.
Sometimes, the IRB prints a warning during boot: irb: warn: can't alias source from irb_source. Explanation
CarrierWave comes with some RSpec matchers which will make testing more comfortable. Let's say you have an Uploader like...
Recent Bundler (1.16.1) started complaining about missing dependencies in the Gemfile. This is due to a stricter handling of specifications...
For applications coming with lots of stylesheets and scripts, asset compilation might take quite long. This can be annoying when...
If the argument list is the same every time: expect(object).to receive(:foo).with('argument').and_return('response 1...
When you find yourself constantly ignoring a RubyMine warning, you can simple disable that warning and de-clutter your editor...
Rails offers a way to prepend (or append) view paths for the current request. This way, you can make the...
Form fields can be rendered as noneditable by setting the disabled or the readonly attribute. Be aware of the differences...
Use bundler > 1.15 to fix Gem::LOADED_SPECS_MUTEX (NameError). Given the following project: ruby -v ruby 1.8.7
Here is how to use Chromedriver without libraries like selenium-webdriver. This can be useful for debugging. The following example...
When flagging a spec that will be implemented later as pending, include a failing spec body or RSpec 3 will...
Note netstat has mostly been superseeded by its more modern rewrite ss which nowadays comes pre-installed rather than netstat...
ActiveSupport::Dependencies takes care of auto-loading any classes in development. This is usually useful, but when you run into...
To check which elements an ActiveRecord relation contains use the contain_exactly matcher. describe User do let!(:admin) { create(:user...
This is a small example on how you can check if your Postgres index can be used by a specific...
The issue: You are using stub_const to change a constant value for your test. stub_const "SomeClass::CONST", 'test...
Rails applications and ruby gems should have a README that gives the reader a quick overview of the project. Its...
You should avoid using application models in your migrations. But how else could you create records in a migration?
Situation: You want to write a spec for a function inside an Angular service. This function at some point makes...