Category: rails

0

How to run only one test in rspec

Mostly while developing its extremely convenient to be able to run just one particular describe block or it block. Rspec lets you do that using a combination of focus: true as well as adding...

0

How to test a private method in rspec

Since you cannot access a private method directly, in order to test a private method, you can make use of the ‘send’ method that is available on all objects. @obj = MyClass.new result =...

0

Auto update Gemfile when installing ruby gems

npm lets you save a module into your package.json file using the –save options. You can do the same in ruby, by installing a gem called ‘gemrat’ and then using that command to install...

0

How to check all the rake tasks that are available for use

The rails rake command comes with a number of tasks. This tiny command shows you a list of all the rake tasks available and a short description. rake –tasks Reference http://stackoverflow.com/questions/10301794/difference-between-rake-dbmigrate-dbreset-and-dbschemaload