similar to: questions rspec on rails

Displaying 20 results from an estimated 7000 matches similar to: "questions rspec on rails"

2007 Oct 09
23
Testing layouts with RSpec on Rails
Hey guys, Does anyone have any wisdom to share on the subject of speccing Rails layouts? Most of it''s plain old view specs stuff, but are there sensible ways to verify things like the yield call? (Mocking doesn''t catch that) Thanks, Matt -- Matt Patterson | Design & Code <matt at reprocessed org> | http://www.reprocessed.org/
2007 Sep 25
7
simple story, extract link
hi, I just started fooling around with story runner, thought I''d start with a dead simple scenario: The first thing I do when describing a site to someone is go to the home page, and begin exploring public pages from there. So, that seems like a good first story to spec out. And I''d really like to extract the actual link from the rendered page (rather than just
2007 Jun 03
3
should_receive.again
Hi, It appears that if I have 2 should_receives in a row, the latest one overrides the previous one(s). If there isn''t one, could we add a way to accumulate them, such as @thing.should_receive(:method).and_return(@value) @thing.should_receive(:method).again.and_return(@value) @thing.should_receive(:method).again.and_return(@value) would be equivalent to
2007 Nov 20
4
cap deploy:spec
fyi, I just posted this http://www.vaporbase.com/postings/Running_rspec_after_you_deploy - linoj
2007 Oct 29
7
rake spec default environment
hi, When I run rake spec , it seems to be starting with my default environment (development or production) and connects to that database, before actually connecting to the test one and proceeding with the tests. When I remove the development database, the specs wont run. How do i initiate rspec to be test environment from the start? I dont see this when i run using script/spec linoj
2007 May 30
6
authentication mocks
hi I''m using restful_authentication and have controller specs working using users fixtures (and login_as) however i''ve been trying for hours without success to do it without fixtures, using mocks and stubs instead. anyone here done this? got code? :) thanks
2007 Jun 02
7
I''m really bad at controllers, help please.
Hey, Sorry for so many questions - I''m really bad at this right now. I''m trying to cover the following code w/ rspec def index if params[:user_id] @user = User.find(params[:user_id]) @messages = @user.messages end end So basically what I''m doing is listing all the messages for a user, provided there is an id parameter. describe
2007 May 25
4
rspec on rails update question
I''m sure this is OT but I''d appreciate the help I''m using rspec_on_rails I prefer to use stable release rather than live dangerously (at least until I can tell the difference between what I might be doing wrong vs problems in rspec). However, I would like to try the RspecScaffoldGenerator fix. I installed (per the docs) last week with the following commands
2007 May 23
3
log file
hi, When running rails spec tests is there a log file generated? i''m looking for generated sql to help me debug like in development.log or is there a way to run the test against a webrick server so i can see logs? (i''m not running with spec_server at the moment, it doesnt seem to work well with autotest) thanks linoj
2007 Nov 18
9
Not sure why this is failing
I am not sure why the tests don''t see the call of the new method for the Address class. It can be seen in the controller method where the Address.new is called. >> @address = Address.new(params[:address]) What am I doing wrong? Thanks for the help. Here is the error message: Spec::Mocks::MockExpectationError in ''UsersController handling POST /users should create a new
2007 May 29
4
rspec and autotest (was: questions rspec on rails)
Do have the latest versions? RSpec-1.0.3 ZenTest-3.6.0 ---------- Forwarded message ---------- From: Jonathan Linowes <jonathan at parkerhill.com> Date: May 29, 2007 11:47 AM Subject: Re: [rspec-users] questions rspec on rails To: rspec-users <rspec-users at rubyforge.org> Hi, I should have mentioned I already did that. Here''s my spec.opts file --colour --format progress
2009 Feb 20
6
How to mock an object defined in the before_filter function?
Hello, I am trying to implement the following scenario, but I am stuck ... The thing is I want to initialize a variable @comment when the stub function "find_comment" is called. The way I do it below doesn''t work, since "before_filter :find_comment" returns true/false and @comment initialization is done inside it. Could you please give me a hint how to do it? One
2007 Oct 02
6
color output?
does story runner have commandline options ,eg to add color to output?
2007 May 30
2
should_eql etc?
Hi, I''m trying the specs for restful_authentication I found here http://jonathan.tron.name/articles/2007/01/02/rspec-on-rails-restful- authentication It seems to use custom .should methods: should_eql, should_be_an_instance_of, should_redirect_to, should_be_success, should_not_be_nil, should_be_nil, should_not_be_nil, should_be_empty, should_be_success, should_not_change, and
2007 Oct 26
2
rspec and capistrano
Hi, has anyone here written a capistrano task for rspec to run through my specs on the deployed server? I''d appreciate a snippet or two to get me started. Thx linoj
2007 Oct 12
6
locals in partials
hiya, in specing a partial, how can i assign a local var that is normally passed via :locals ? i tried adding :locals => to the render call but that doesnt seem to take linoj -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071012/fd0acd92/attachment.html
2008 Jan 23
6
sharing specs in a subclass
Hi I''ve spec''d a class and they pass. Now I''d like to assure that any subclass of this class also passes the same specs. Any suggestions for a clever way to handle this? I''d prefer to keep the existing specs as is (eg instead of moving everything into shared behaviors, or doing something to all the ''describe'' lines) thanks linoj
2007 Oct 17
4
works in script but not in rake
Hi, This is weird All my current spec examples are passing (about 750 of ''em) except a set of 6 in a specific controller spec. I get the following failure on each 6 when I run it via $ rake spec for example: --- ActionController::UnknownAction in ''MembershipsController handling PUT /project/ID/membership/N/accept should flash message'' No action responded to
2007 Jun 21
4
should_receive stubs methods?
Hey, I''m using rspec and rails and have a spec that tests if a before_filter is executed, I also have a spec that tests if a method called by the filter is executed. It appears however that when I should_receive something, it is no longer actually called when I fire the http request. I''m not sure how, or where exactly I should manually fire the filter, either before or after the
2007 Oct 25
3
Setting session values
Okay, I give up. I have been trying to set session values in a controller, but no matter what, once the request is made and inside the controller, the session is empty. What''s the correct way? I have tried session[''whatever''] = something controller.stub!(:session).and_return(session) I tried creating a new session, but nothing seems to do it. I''m sure