similar to: nested describe blocks

Displaying 20 results from an estimated 30000 matches similar to: "nested describe blocks"

2007 Nov 28
6
textmate bundle
Does anyone else have issues running rspec textmate bundle? I''ve got revision 2997, but the blasted thing just won''t run. It is checked out to my /Users/zdennis/Library/Application Support/TextMate/Bundles/RSpec.tmbundle When it runs I get the below error... "textmate" is not a valid class name
2008 Mar 08
7
ridding away with do_request
I''m heading out of town, but had a quick thought I wanted to share. Rather then using ambiguous named request helpers in controller specs like "do_request", I''ve been using more readable helpers like "post_create". For example... describe ProjectController do def post_create post :create, ... end before do end it "creates a new
2007 Aug 16
17
undefined method `mock_model'' for [RSpec example]:#<Class:0x25550a8>
I am getting: undefined method `mock_model'' for [RSpec example]:#<Class:0x25550a8> with my view specs after upgrading to 1.0.8. Is anyone else seeing this? To isolate the message I did the following setup: - create new rails project (with edge) - installed rspec and rspec_on_rails - ran rake spec - ran script/generate rspec_scaffold products - tried to run a builtin view
2007 Oct 13
13
Story Runner: Readability of output with multiple params
Fistly, many, many thanks for RSpec and Story Runner. Minor request to improve readability of output Given a scenario item with multiple params.. Eg. And "the user belongs to", "Joe", "Acme" do |user_name, company_name| The readability of the following output is less than ideal.. "And the user belongs to company,Joe Public, No Videos" It would be
2008 Dec 16
20
step definitons to check login
I am working with the authlogic gem and trying to create a simple login test from cucumber features. The feature statement is: Given the user is not logged in The step definition for this is confounding me. In the application_controller the authlogic tutorial recommends the following: private def require_user unless current_user store_location flash[:notice] =
2007 Dec 29
15
Do you think it would look cleaner?
I was looking over some of my specs. I was thinking that the following: @game.should_receive(:name).and_return(''The Battle for Blaze'') @game.should_receive(:people).and_return(5000000) @game.should_receive(:activated).and_return(true) Would it look cleaner if I could do this instead? @game.should_recieve_and_return( :name => ''The Battle for Blaze''
2008 Oct 30
2
Mailing list playing catch up with anyone else?
Last night it seemed like the mailing list was playing catchup, as I got a flood of emails from the past few days. Has anyone else seen this? -- Zach Dennis http://www.continuousthinking.com http://www.mutuallyhuman.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081030/f19f3755/attachment.html>
2008 Nov 07
15
any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?
-- Sent from my mobile device
2008 Aug 26
9
stub_model() and ActiveRecord Associations
Hi all, I have what I thought was quite a simple requirement but something to do with the way ActiveRecord''s associations work is making it quite puzzling. I guess I can sum it up with this failing test: before(:each) do @source_comment = @source.comments.create(:user_id => 1) @target_comment = @target.comments.create(:user_id => 1) end
2009 Apr 19
19
Controller spec: testing that scope is set
In a Rails controller I set the scope on a model class in an around filter. I have defined expectations on the model classes, and ideally, I would add a further expectation for the scope. Is this already possible in some way? How would I go about adding support a scope expectation? Michael -- Michael Schuerig mailto:michael at schuerig.de http://www.schuerig.de/michael/
2008 Mar 11
6
Story testing views in isolation
Hi, I''ve been investigating plain text stories, and I had a quick question. How would I go about creating story tests for views in isolation, instead of the full stack? I had hoped to be able to do a straight render ''/'', but it says it can''t find the method. The reason that I want to do this is that I want to give our designer/business people a way to write
2008 Oct 20
5
RSpec-Rails bug with to_xml?
Hello, everyone. I''ve been lurking here for a while, but this is my first post. I think I''ve run into a RSpec bug in a Rails project I''m working on. I was working on a few REST controllers, and started getting failures on a specific spec that verified whether a certain action returned XML output. I spent quite a lot of time checking my code to see if it was something I
2008 May 08
7
Rspec Stories / Selenium Nightmare
I have been using Rspec stories with Webrat feeling very productive and happy. Then I needed to do something with Selenium (Webrat could have done what I needed but it does not yet have the functionality). Selenium-core as part of a rails plugin looked nice but did not seem to fit with rspec stories. So I went the Selenium-rc route. Since Selenium uses a separate instance of rails
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
2008 Aug 25
21
How much test data to use in specs
I''m not sure how much test data I should be using in my specs. I''m writing specs for the Property model in my Rails app. Its "address" attribute is going to be validated with this regex: /\A\d+[a-z]? [-'', a-z]{2,128}\Z/i At the moment, my plan is to spec out the following possibilities. A property is invalid if its address: 1) doesn''t begin with
2008 May 14
4
Reuse steps like a method call
If I have a step matcher defined as so: Given "a user named $username" do |username| .... end Is there a way to call it from another step? For example: Given "a user named $username with a blog post |username| given_a_user_named(username) # calls existing step code # create a blog post end Cheers, -- Bryan Helmkamp http://brynary.com -- My blog
2008 Mar 05
14
[Stories] Login and subdomain
I''ve just begin using rspec stories, and i m encountering some problems. In my application i have different subdomains in which specific users can log in, for example an admin will go to admin.myapp.com/authenticate/login, and an user belonging to a specific company will log in company.myapp.com/authenticate/login, and of course both have a different login process. To perform some
2007 Oct 20
14
Problems with form_for and partials
i''m having problem with a form_for situation where i''m trying to DRY out the repeated parts of my forms and put them in common/form and render the form elements via another partial in controller_name/_form. Here''s the first form # app/views/common/form <% form_for ... do |f| -%> <%= render :partial => "params[:controller]/form", :object => f
2008 Jun 05
2
xhr :post giving wrong number of arguments on rails 2.1?
Getting a strange error. In a story I have the following step: When "I submit a search name" do xhr :post, ''/searches'', {:search => {:given_name => "bob", :family_name => "smith"}} end I am getting: ArgumentError: wrong number of arguments (4 for 3) stories/searching_story_spec.rb:45 in "I submit a search name" But I only
2007 Aug 13
3
RSpec-1.0.8
The RSpec Development Team is pleased to announce the release of RSpec-1.0.8. RSpec 1.0.6 is the "holy cow, batman, it''s been a long time since we released and there are a ton of bug fixes, patches and even new features" release. RSpec 1.0.7 and 1.0.8 deal with a regression introduced in 1.0.6 and a hiccup in releasing 1.0.7, respectively. == RSpec RSpec is a Behaviour Driven