Hi,
This fails:
describe UsersController::QuickSearch do
controller_name "users"
describe "created with search text" do
before(:each) do
@quick_search
UsersController::QuickSearch.new("quick_search[search_text]" =>
"search_text")
end
it "should turn search text into a search on the first name, surname,
username and secondary email" do
@quick_search.to_conditions.should == {
:conditions => "..."
}
end
end
end
with this error:
ArgumentError in ''UsersController::QuickSearch created with search text
should turn search text into a search on the first name, surname, username
and secondary email''
wrong number of arguments (0 for 1)
script/spec:4:
But if I comment out the nested describe
# describe "created with search text" do
before(:each) do
@quick_search = ...
#
it works fine.
Anyone got any ideas? I must be doing something stupid, I''ve got a
nearly
identical one immediately below.
Thanks
Ashley
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/rspec-users/attachments/20080327/c75f64bd/attachment.html
On 27/03/2008, Ashley Moran <ashley.moran at patchspace.co.uk> wrote:> > I must be doing something stupid, I''ve got a nearly identical one > immediately below.I lied, it was not identical, but when I nest another one where I have to specify the controller it warns me. Adding this to the NESTED describe block fixes it: controller_name "users" Don''t know why it gives such a mysterious error instead of "You have to declare the controller name in controller specs." though. Known bug, or in need of a LH ticket? Desirable behaviour would seem to be that inner blocks inherit the controller. Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20080327/ff3f537d/attachment-0001.html
On Thu, Mar 27, 2008 at 9:35 AM, Ashley Moran <ashley.moran at patchspace.co.uk> wrote:> > > > On 27/03/2008, Ashley Moran <ashley.moran at patchspace.co.uk> wrote: > > I must be doing something stupid, I''ve got a nearly identical one > immediately below. > > > I lied, it was not identical, but when I nest another one where I have to > specify the controller it warns me. Adding this to the NESTED describe > block fixes it: > controller_name "users" > > Don''t know why it gives such a mysterious error instead of "You have to > declare the controller name in controller specs." though. > > Known bug, or in need of a LH ticket? Desirable behaviour would seem to be > that inner blocks inherit the controller.This is fixed in trunk. Pat
On 27/03/2008, Pat Maddox <pergesu at gmail.com> wrote:> > > This is fixed in trunk.Ok cool, as it happens I just updated to trunk to get the nested shared example groups. Ta Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20080327/ccb3fd8c/attachment.html