failure/error response.should render_template new Hale Missouri

HCGI focuses on bringing buyers & sellers together of industry specific equipment, parts, supplies & services through print, digital & multimedia sources.

Address 2000 E 315th St, Drexel, MO 64742
Phone (816) 619-2001
Website Link http://heartlandcommunicationco.com/
Hours

failure/error response.should render_template new Hale, Missouri

We recommend upgrading to the latest Safari, Google Chrome, or Firefox. As it stands now, you'll get an error that says the template is missing, so you know exactly what you have to do next. I'm a convert and that's all that matters). Msan Msan (msan) on 2011-05-29 21:37 On 29 May 2011 10:45, egervari wrote: >> I have the new template under app/views/sectors but the test says: >> >> SectorsController POST create

Any thoughts on that? Failures: 1) CompaniesController new action should render new template Failure/Error: response.should render_template(:new) expecting <"new"> but rendering with <""> # ./spec/controllers/companies_controller_spec.rb:26:in `block (2 levels) in ' 2) CompaniesController create action should Sign in Email Address Password I forgot my password Sign in Ruby-Forum.com Ruby Ruby Ruby on Rails JRuby Ruby Jobs About this forum Ruby-Forum Non-English Italian Ruby Group Forum: Ruby on This allows you specify which view template an action should try to render regardless of whether the template compiles cleanly.

Personal Open source Business Explore Sign up Sign in Pricing Blog Support Search GitHub This repository Watch 48 Star 2,558 Fork 329 josevalim/inherited_resources Code Issues 5 Pull requests 7 Projects Only necessary if you # are using the confirmable module user.confirm! In it, you'll get: The week's top questions and answers Important community announcements Questions that need answers see an example newsletter By subscribing, you agree to the privacy policy and terms Forum List Topic List New Topic Search Register User List Log In how can I investigate when a rspec test fails?

Journal.any_instance.should_receive(:update).with({ "title" => "MyString" }) put :update, {:id => journal.to_param, :journal => { "title" => "MyString" }}, valid_session end 内容 Failures: 1) JournalsController PUT update with invalid params re-renders the 'edit' If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message. (0.1ms) rollback transaction **Rendered accounts/new.html.erb within layouts/application (1.4ms)** Completed 200 OK more hot questions question feed lang-rb about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation RSpec member dchelimsky commented Jun 27, 2010 Another approach would be to add a stub_template method (something I'd been thinking of anyhow) and use that in the generated controller specs: stub_templates

Say I'm writing a controller spec and a better representation of my problem becomes apparent (which may be less-than conventional, but involves say... RSpec member dchelimsky commented Jun 27, 2010 OK - I've pushed this change: http://github.com/rspec/rspec-rails/commit/61f5bcc8a79d2199759563f4fd12c1b6948c9e11 We still have the other issue to deal with, which has to do with the implementation of Stubbing :save => false only works if it's part of the mock_model method: mock_model(Post, :save => false) The generated specs add the stubs after it's been created: def mock_post(stubs={}) (@mock_post ||= valid_attributes # Trigger the behavior that occurs when invalid params are submitted Journal.any_instance.stub(:save).and_return(false) put :update, {:id => journal.to_param, :journal => { "title" => "invalid title" }}, valid_session response.should render_template(:edit) end it

https://github.com/plataformatec/devise (see "Test helpers") https://github.com/plataformatec/devise/wiki/How-To:-Controllers-and-Views-tests-with-Rails-3-%28and-rspec%29 I'm using FactoryGirl, so this is the solution I went with: $ cat spec/support/controller_macros.rb module ControllerMacros def login_user before(:each) do @request.env["devise.mapping"] = Devise.mappings[:user] user = Factory.create(:user) raise error elsif has_errors? && default_action render :action => default_action else redirect_to navigation_location end end ... Gavin Laking (gavinlaking) on 2011-05-28 20:36 This can happen if the action is actually redirecting instead of rendering, one potential way to test this is to change your stubbed method to valid_attributes # Assuming there are no other journals in the database, this # specifies that the Journal created on the previous line # receives the :update_attributes message with whatever params are

Make space between rows constant Are independent variables really independent? Truth in numbers Determine if a coin system is Canonical Why are so many metros underground? jan0sch closed this Oct 10, 2011 Sign up for free to join this conversation on GitHub. Is there a role with more responsibility?

Forum List Topic List New Topic Search Register User List Log In Powered by RForum and Captchator. raise error elsif has_errors? && default_action render :action => default_action else redirect_to navigation_location end end ... How to decrypt a broken S/MIME message sent by Outlook? Report post Edit Delete Reply with quote Re: how can I investigate when a rspec test fails?

I > receive the following errors only on my create and update actions > (with invalid parameters) and only on my namespaced controllers. Journal.any_instance.should_receive(:update_attributes).with({ "title" => "MyString" }) put :update, {:id => journal.to_param, :journal => { "title" => "MyString" }}, valid_session end ``` ## 参考リンク [respond_to について調べてみた](http://dev.classmethod.jp/server-side/rails-respond_to/) [josevalim/inherited_resources](https://github.com/josevalim/inherited_resources) 編集リクエストを送る投稿者に記事をより良くするための提案ができます 💪ツイートPR 社内メールでの情報共有をなくそう - Qiita:TeamComments Loading...あなたもコメントしてみませんか I'm re-working the view isolation so that the template has to actually exist, but its content will not be evaluated. But my point (I knew I had one somewhere) is this: Are you fully sold on the semi-trade-off of isolation that's involved with this rework?

config.include RequestMacros, :type => :request end Like this:Like Loading... RSpec member dchelimsky commented Jun 27, 2010 Yes, that's the cost side of the trade-off. As you can imagine, I well acquainted with every commit breaking something or another. On the surface it seems reasonable, but things will get confusing for anyone who strays from convention (i.e.

For some reason errors are not being set or read or something, so just stub them and you're get the proper rendering. I don't understand why the test in the first application doens't work while the one in the second application works. Is the mass of an individual star almost constant throughout its life? valid_attributes # Trigger the behavior that occurs when invalid params are submitted # Journal.any_instance.stub(:save).and_return(false) put :update, {:id => journal.to_param, :journal => { "title" => nil }}, valid_session response.should render_template(:edit) end it

Skip to content Ignore Learn more Please note that GitHub no longer supports old versions of Firefox. You signed in with another tab or window. Once I make the change I described, you won't have to use render_views to use respond_with. Code from ability.rb: user ||= User.new if user.is?(:admin) can :manage, :all else can :read, :all cannot :read, User, :id != user.id end Code from my controller specs: def setup @current_user =

How to handle a senior developer diva who seems unaware that his skills are obsolete? Will follow up. Any thoughts on that? I've been ignoring these for a while > and it's time to fix them. > > Cheers, > Adam > _______________________________________________ > rspec-users mailing list > [hidden email] > http://rubyforge.org/mailman/listinfo/rspec-usersAn empty

It should work, but it refused to. Any help is greatly appreciated. RSpec member dchelimsky commented Jun 27, 2010 And yet another approach would be to require that the templates actually exist, but just not render them by default. valid_attributes # Assuming there are no other journals in the database, this # specifies that the Journal created on the previous line # receives the :update_attributes message with whatever params are

We'd still get the isolation from the content of the templates, but not from their existence. phillipkoebbe commented Jun 27, 2010 To handle this gracefully, RSpec could assume that successful GET requests and failed POST, PUT, and DELETE requests should be able to find a template (using