search for: should_redirect_to

Displaying 11 results from an estimated 11 matches for "should_redirect_to".

2007 Feb 01
3
should_redirect_to in rspec-0.8.0 / rspec_on_rails 1453
...ns[:user].should_not_be_nil assigns[:user].new_record?.should_not_be(true) flash[:notice].should_match(/user added/) response.should_be_redirect puts "redirecting to #{response.redirect_url}" puts "this response was #{response.redirect?}" controller.should_redirect_to ''http://test.host/user'' end the puts statements output the following: redirecting to http://test.host/user this response was true Any idea why this line: controller.should_redirect_to ''http://test.host/user'' would fail with the message: ''Given a...
2007 Jan 05
2
Using RESTful routes in controller tests
Why can''t I use the RESTful route helpers in my specs? In my controller I''m doing a redirect: redirect_to list_path(:id => @item.list_id) Now when I write: controller.should_redirect_to list_path(:id => 2) I''m getting the following error: NoMethodError in ''POST on /lists/2/items should redirect to index on succesful POST'' You have a nil object when you didn''t expect it! The error occurred while evaluating nil.rewrite (eval):19:in `list_path&...
2006 Nov 07
7
should_redirect_to in advance - feels unnatural
I can understand that it''s easier for rspec to set up a mock in advance of the controller call. But it makes it difficult to do something like: context "The HarkController, given Louie the logged-in user" do setup do post :login, :username => ''louie'', :password => ''atest'' end specify "should redirect Louie to the home
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 should_not_be_activated Is this using an old version of rspec, and/or do i need to define these methods and how? thanks linoj
2007 Jun 19
5
Problems translating should_render from 0.8.2 to 1.0.5
...p; So we ran the translator and yet we''re having a lot of trouble translating should_render.<br><br>I found this on the web:<br><br>We will NOT be supporting the following in the new syntax:<br>&nbsp; controller.should_render<br>&nbsp; controller.should_redirect_to<br><br>You will be able to use instead:<br>&nbsp; response.should render_template<br>&nbsp; response.should render_text<br>&nbsp; response.should redirect_to<br><br>But the problem I have is that render_template doesn''t have the functio...
2006 Nov 23
2
Some tips for testing respond_to block and making controller tests work with simply_helpful
Hi, Here''s two blog posts for those that need to test respond_to blocks and/or are currently using simply_helpful extensively. http://blog.methodmissing.com/2006/11/22/testing-different-content- types-with-rspec http://blog.methodmissing.com/2006/11/23/using-simply_helpful-with- rspec-controller-tests - Lourens
2007 Apr 11
10
DRYer controller specs
So, I''ve been following the recommendations for controller specs here: http://blog.davidchelimsky.net/articles/2006/11/09/tutorial-rspec-stubs-and-mocks Most notably: a single expectation per specify block; the setup block contains only stubs; mock expectations each get their own specify block. (I''m still using 0.8, so I haven''t gotten the describe/it goodness yet.) I
2007 May 08
4
help with rspec''ing controller
Hi, I''m a rspec newbie. I''m having trouble with rspec''ing a simple controller to Create a record. I''ve tried a couple of approaches and still get errors: Mock ''remedy'' expected :save! with (any args) once, but received it 0 times -or- Mock ''Remedy'' received unexpected message :save with (no args). Here are my two
2007 May 02
13
RSpec 0.8.2 pain, missing spec/rails?
Hi. I''m upgrading a project from an 0.8.0 pre-release gem to 0.8.2. I''ve installed the 0.8.2 gem, and the rspec_on_rails 0.8.2 plugin: ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/REL_0_8_2/rspec When I try to run my specs though, I get the below error. It''s as if the spec_helper cannot find "spec/rails". I''ve noticed that
2007 Feb 02
7
Coming Soon...
...ot;, you''ll have a very easy means of doing so. == Will there be any existing expectations that will no longer be supported at all? Yes, but only a few, and only related to RSpec on Rails. We will NOT be supporting the following in the new syntax: controller.should_render controller.should_redirect_to You will be able to use instead: response.should render_template response.should render_text response.should redirect_to ... but only after the action. == For )(*&)(*''s sake, WHEN will you stop making changes like this? Right now. While we will not commit to 100% backwards...
2007 Jul 26
5
Coding standards and whitespace
...c.tmbundle/Snippets/should_raise.tmSnippet RSpec.tmbundle/Snippets/should_receive.tmSnippet RSpec.tmbundle/Snippets/should_receive_with_any_args.tmSnippet RSpec.tmbundle/Snippets/should_receive_with_args.tmSnippet RSpec.tmbundle/Snippets/should_receive_with_no_args.tmSnippet RSpec.tmbundle/Snippets/should_redirect_to.tmSnippet RSpec.tmbundle/Snippets/should_render.tmSnippet RSpec.tmbundle/Snippets/should_respond_to.tmSnippet RSpec.tmbundle/Snippets/should_satisfy.tmSnippet RSpec.tmbundle/Snippets/should_throw.tmSnippet RSpec.tmbundle/Snippets/teardown.tmSnippet RSpec.tmbundle/Snippets/twice.tmSnippet rspec_on_r...