search for: find_alphabetically

Displaying 1 result from an estimated 1 matches for "find_alphabetically".

2007 Aug 24
26
testing behaviour or testing code?
...:widgets].first.name.should == ''blue'' assigns[:widgets].last.name.should == ''red'' end with the first method, I get to mock the important calls and stub the rest, but the example is very closely tied to the implementation. If I change from Widget.find to Widget.find_alphabetically then the example breaks (assuming find_alphabetically() doesn''t use AR::Base.find) with the second method, I''m testing the behaviour more than how it''s implemented. I don''t care what the action does as long as it gives me an array of widgets sorted alphabeticall...