search for: andylindeman

Displaying 2 results from an estimated 2 matches for "andylindeman".

2012 Sep 27
3
load global variable so I can access in spec files
In my spec_helper, I want to load yaml file to a variable, and then be able to use that in my tests. spec_helper.rb: RSpec.configure do |config| end config = YAML::Load(......) some_spec.rb describe ''blah'' do it "should be...." do MyClass.new( config[''test''] ) end end How can I do this? -------------- next part -------------- An
2012 Oct 09
8
unexpected should_receive behaviour
Hi, surely I''m missing something... but what!? in my spec I''ve User.should_receive(:find).with("1").and_return(@user) and in my controller User.find(params[:id]) green light... correct... but if I change my controller using another method, for example first: User.first or even User.all I get green light too... I was expecting an error like expected: 1 time