similar to: RSpec, flash messages and redirection

Displaying 20 results from an estimated 11000 matches similar to: "RSpec, flash messages and redirection"

2012 Jan 15
2
DEPRECATION WARNING: Passing a template handler in the template name is deprecated. (rspec + haml)
I upgraded a small project that I had created on 3.1.3 to 3.2.0.rc2. Running rspec on it brings about a large amount of these messages: DEPRECATION WARNING: Passing a template handler in the template name is deprecated. You can simply remove the handler name or pass render :handlers => [:haml] instead. (called from block (2 levels) in <top (required)> at
2010 Dec 17
1
flash[;notice] not display after redirection
I read all previous posts about the same subject in Devise group but couldn''t find any answer, so iy may not be related to Devise , so I debugged it .. . class Users::RegistrationsController < Devise::RegistrationsController .. # POST /resource/sign_up def create build_resource if resource.save if resource.active? set_flash_message :notice, :signed_up
2008 Jul 03
0
Testing HAML in helper rspec
Thought I''d post this under its own heading so others can find it. Thanks to David for the pointers to solve this. Here is the incantation needed to use HAML 2.0 under RSpec 1.1.5 (Needs the .5 for a fix) # application_helper_spec.rb under spec/helpers ... before :each do helper.extend Haml helper.extend Haml::Helpers helper.send :init_haml_helpers end it
2008 Sep 25
0
Rspec, HAML with view testing
Hi all, Has anyone experienced the following problem testing rspec against haml views Attempting to run a view spec (partial) app/view/users/_foo.html.haml it "should render it" do render :partial => "users/foo", :locals => template_locals end The following error is returned: 1) ActionView::MissingTemplate in ''shared/_jar_layout should render
2008 Sep 24
0
Rspec, HAML, view testing
Hi all, Has anybody experience the following problem running testing rspec against haml views Attempting to run a view spec app/view/users/_foo.html.haml it "should render it" do render :partial => "users/foo", :locals => template_locals end 1) ActionView::MissingTemplate in ''shared/_jar_layout should render it'' Missing templatet
2012 Jun 14
1
Cucumber/RSpec ::: Capybara? Webrat What am I using??
Hey everybody I''m currently reading through the Pragmatic Programmers RSpec book, and I really enjoy it. But I’m facing some problems because of the fact that the book is already some years old, I guess. I have installed rvm and use Ruby 1.9.3, and I didn’t really get some Rails code examples to work properly, so I tried it with a 1.8.7 installation, but there I had some other problems
2008 Jun 02
2
Cannot log in/authenticate within RSpec Story
I''ve been slamming my head against a wall for a while now, and would like some help. I believe this is session related. I have a story that looks like: -------------------------------------------------- Given that a post exists And I am logged in When I visit the post details page Then there should be a link to add a new comment
2007 May 19
2
have_text matcher does not support should_not.
Hello Guys, Doing conversion of some test for some controllers, still with integrated views. Anyway, I have this: it "should not see Join This Group button on profile page as member" do get "show", :id => @group.id response.should be_success response.should_not have_text(/Join This Group/) end But running with spec (0.9.4), drop me the folling error:
2007 Nov 20
3
How to test views with Nested Resources and Partials
Hi everyone, I am relatively new to rspec and I am running into a wall in testing my views. I have a RESTful resource Contracts with a nested resource of Line_items. I am trying to figure out how to test the "edit" form of the Line_items. What complicates this is the nested routing and how to account for it, and that there is a partial form (_form.haml) that both the edit.haml and
2010 Sep 30
5
response.should have_text leads to undefined method `has_text?'
One of my controllers directly renders some JSON output that I would like to test with RSpec. For that I use ''response.should have_text("foobar")'' in my spec file, but that leads to a Failure/Error: response.should have_text("enim") undefined method `has_text?'' for #<ActionController::TestResponse: 0xb6736944> I read here somewhere that webrat
2007 Oct 02
1
flash in story runner
hi, is there a way to assert a flash message directly in story runner? Or do I have to go through the response text instead. Then "flash message should say success" do #flash[:notice].should == "User successfully invited" response.should have_text(/User successfully invited/) end linoj
2006 Mar 13
1
issue with redirect_to
Hi all: I can''t make redirect_to to unlock the current iframe using {:TARGET => "_top"}. It always stays in the current frame. I checked the redirect_to code, it seems the method does not use "target". here is the source code of redirect_to from ActionController::Base def redirect_to(options = {}, *parameters_for_method_reference) #:doc: 753: case options
2007 Oct 16
6
RailsStory runner - empty response
I generated a new rails app then installed rspec and rspec_on_rails from trunk. I then created a sample story: require File.dirname(__FILE__) + "/helper" Story "View Home Page", %{ As a user I want to view my home page So that I can get a birds eye view of the system }, :type => RailsStory do Scenario "Publisher with no videos" do When
2009 Oct 06
3
rspec-rails 1.2.9 Released
rspec-rails version 1.2.9 has been released! * <http://rspec.info> * <http://rubyforge.org/projects/rspec> * <http://github.com/dchelimsky/rspec-rails> * <http://wiki.github.com/dchelimsky/rspec/rails> * <rspec-devel at rubyforge.org> Behaviour Driven Development for Ruby on Rails. Changes: ### Version 1.2.9 / 2009-10-05 * enhancements * added route_to and
2008 Apr 07
0
Haml and View tests
Does Rspec work nicely with Haml for controller integrated view tests? I am getting the following error: =================== ActionView::TemplateError in ''Admin::ListingsController index should get a 200 OK'' undefined method `photo'' for true:TrueClass On line #2 of admin/listings/_listing.html.haml 1: %tr 2: %td.photo= image_tag(listing.photo.url(:thumb),
2007 Dec 12
0
Alternate file jump in Textmate
Hello all, Using RSpec 1.1 RC from the SVN source. Running in Textmate with the bundle, all working good. Got a problem with the Alternate File jump (Ctl Shift DownArrow) because it works fine in Rails with the html.erb templates, but I can not figure out how to get it working with HAML templates that I am using. For ref, my specs are called: spec/views/users/edit.html.haml_spec.rb For the
2011 Aug 28
3
rspec-rails render_views doesn't render layouts? / how to check flash isn't rendered
I''m trying to test that "static" pages (they''re ERB, but get cached), generated through rails, don''t render any stray flash notices left over by the authentication system (Devise) or wherever else. I''ve tried writing this controller spec, but it appears that response.body only renders the template, not its layouts? describe "so that static
2009 Nov 17
8
rspec-rails gem double quoting (My)SQL?
Hi all, This seems like a plugin conflict (I haven''t yet had success replicating this in a new project), but short version is: when I have "rspec-rails" in my environment.rb plugin config, table names are double quoted in mysql queries generated by my standard finders. rspec-rails commented out: SELECT * FROM `users` WHERE (`users`.`id` = ''159564615'')
2010 Dec 21
5
Rails, Ruby, haml, metaprogramming problem
In HAML I have hundreds of lines like the following: - xyz = someFuncThatReturnsString(''xyz'') and elsewhere %div{''id'' => xyz} The above lines work fine. - - - Attempting to keep things DRY (Don''t repeat yourself) I want to do something like - eval(otherFuncThatReturnsString(''xyz'')) where
2012 Dec 04
0
Empty test suite is run after every rake task
When I run rake db:migrate or rake -T I get these lines at the end: Finished in 0.000276 seconds. 0 tests, 0 assertions, 0 failures, 0 errors My Gemfile is: source ''http://rubygems.org'' gem ''rack'' gem ''rails'', ''3.0.9'' gem "acl9", ''0.12.0'' gem "fastercsv"#, :version =>