similar to: verifying the assignment to flash

Displaying 20 results from an estimated 100000 matches similar to: "verifying the assignment to flash"

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
2007 Feb 07
1
advice on a spec''ing best practice
i am in the process of converting the tests in two projects that i am working on (one rails, one ruby) to rspec. i felt like i was doing ok applying BDD and using rspec properly until i read a comment in another topic on the list from David (subject "long jumping out of code in specs"). In there it was said: --- Testing privates is a no-no, but testing that a public method on the same
2011 Mar 10
2
Trying to test flash messaging with rspec
Hello every one, So my this rspec test fails: [code] it "should have a welcome message" do post :create, :user => @attr response.flash[:success].should eql("Welcome new user!") end [/code] However when I create a new user the flash message does display just as I had wanted it to. The controller has this in it: [code] def create @user =
2007 May 30
0
Error when accessing flash through helper specs
Running edge rspec/rails I''m having a heck of a time testing helpers which are accessing the flash(1) since changeset 2044. Is anyone else seeing this problem? Has anyone found a workaround and or proper fix? Josh 1: http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11223&group_id=797 -------------- next part -------------- An HTML attachment was scrubbed... URL:
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
2007 Nov 01
3
no speed up with spec_server
Hey guys, I''m running spec_server and using --drb with my specs in Rails, and I''m seeing virtually no speed up. I''m using rspec/rspec_on_rails trunk. Is there something I''m doing wrong? TIA, Jeremy -- Jeremy Stephens Computer Systems Analyst I School of Medicine Department of Biostatistics Vanderbilt University
2008 Jan 26
0
RSpec and resource_controller plugin
I just discovered James Golick''s resource_controller plugin http://jamesgolick.com/resource_controller after spending another stretch of boredom making the changes to nest yet another rails resource controller. I''d actually slowed down this time to think about what I was doing in hopes of automating the task. I''ve tended to use script/generate rspec_scaffold to get
2009 Oct 13
0
RSpec, flash messages and redirection
Hello everybody I''m having some problems with RSpec. 1) When using something like "I should see ''some text''" that text is set on a flash message in the controller and displayed by = flash[:notice] in the layout view, so the relevant part of my view says, in haml: .notice = flash[:notice] The rspec evaluation for that says: response.should
2007 Nov 03
1
Specs for Helpers that call render
The helper spec I am writing tests a helper method that calls render. ## module HelperHelper def render_partial render :partial => ''partial'' end end ## The helper spec. ## describe HelperHelper do it "should render partial" do render_partial.should_not == nil end end ## The output generated ## $ spec spec/helpers/home_helper_spec.rb .F 1)
2006 Nov 10
3
Specifying views
I''m trying to spec my views with 0.7.1 on edge rails per the instructions on the rspec site [1] and David''s blog [2], but I''m not having much luck. Here''s my spec in specs/views/accounts/ new_view_spec.rb: require File.dirname(__FILE__) + ''/../../spec_helper'' context "The new account form" do specify "should have an
2007 Oct 30
1
flash should be empty (typeError)?
Hi, I''m trying to test wether flash.now[:okay] is not empty, but I always get the following error. TypeError in ''UserController'' can''t convert String into Integer Can''t I test the flash if they are not emtpy? Thanks for help :D //Jamal -- Posted via http://www.ruby-forum.com/.
2013 Aug 30
1
Re: ext3 / ext4 on USB flash drive?
Agh. This is great to have some of this clarified, Ted. It does unfortunately reinorce my cynicism. But it also fills my heart. That is, though it might be bad news to hear that I have most likely bought a piece of crap, and that there's no way I can really tell what's inside the cover unless either I do some kind of low-level alchemy of a kind that mere users would normally be well
2008 Nov 06
3
Verifying some understanding about manipulating DB data in before/after callbacks in RSpec
We had an after(:each) callback that looked like this: PurchaseOrder.find(:all).each {|po| DraftInvoice.find_all_by_po_number(po.po_number).each {|di| di.destroy}} which we were hoping would reset some purchase order data in a certain way. However, because we have "self.use_transactional_fixtures = true" set in test_helper.rb, this code was never getting committed. So, I just
2004 Apr 29
2
Flash on X100P does not really flash.
Problem: Flash on X100P does not flash. Phone line has Call Transfer. With this line plugged into a regular phone, it can receive a phone call. Then, depress the hook momentarily, release. Dialtone is now available. Dial a different number. Call is answered. Hook Flash again, now in a three way call. Hang up. The other two parties are still in communication. Now, plug same line into the X100P.
2017 Mar 18
0
"isolinux.bin missing or corrupt" when booting USB flash drive in old PC
Hi, David Christensen wrote: > I use this USB flash drive for bootable installer images; I do not > attempt to mount it. I don't know that I could, even if I wanted to: mkdir /mnt/iso mount /dev/sdc /mnt/iso or, because partition 1 starts at block 0, you may mount it too mount /dev/sdc1 /mnt/iso > # fdisk -l /dev/sdc > WARNING: GPT (GUID Partition Table) detected on
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 Mar 19
2
rescue
Hi, whats the correct way to spec a rescue? This will raise it but doesnt test my code''s response # controller def edit @foo = Foo.find(params[:id]) rescue flash[:notice] = "Unknown foo #{params[:id]}" redirect_to foos_path end # spec it "should flash error if not found" do Foo.should_receive(:find).and_raise get :edit, :id
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 May 22
3
Comments wanted about spec''ing out a couple controller methods
(oops, accidentally sent this to the rspec-devel list, sorry about that) Could someone help me spec out these Rails controller methods? I don''t know where to get started, especially with the transaction stuff. Or, if anyone else could suggest ways I could improve the code, that would be great as well. Puzzle has_one Media. Both are AR model objects. class PuzzlesController <
2007 Apr 17
8
Verifying that a block calls a method
I have something like the following: def my_fun my_fun2 do raise Error end end I know that I can verify that the method receives my_fun2. How can I mock/stub out the example to verify that it calls raise Error? Scott