isolate_namespace description with example

taimoorchangaiz Jul 16, 2013

Normally when you create controllers, helpers and models inside an engine, they are treated as if they were created inside the application itself. This means that all helpers and named routes from the application will be available to your engine’s controllers as well.

However, sometimes you want to...

correct, but ..

aghyad Jul 12, 2013 1 thank

stub_chain provides a very good replacement of long lines of nested stubs, but never forget it violates Law of Demeter; i.e. it indicates an increase of coupling in your classes and this is a bad thing because it means your objects now are making more unnecessary calls to other objects. for example:...

Accept header ignored

filipegiusti Jul 11, 2013

Rails ignores the accept header when it contains ",/" or "/," and returns HTML (or JS if it's a xhr request).

This is by design to always return HTML when being accessed from a browser.

This doesn't follow the mime type negotiation specification but it was the only way to circumvent old browse...

as_null_object working

taimoorchangaiz Jun 3, 2013 1 thank

It only listen for the messages we tell it to expect and ignore any other messages.

For example:

spec/codebreaker/game_spec.rb

module Codebreaker describe Game do describe "#start" do before(:each) do @output = double('output').as_null_object @game = Game.new(@outpu...