Displaying 20 results from an estimated 69 matches for "continuousthinking".
2007 Oct 04
2
nested describe blocks
...e is the output with 1.0.8:
a
SHOULD
b
SHOULDN''T
The 1.0.8 output is what I expect. I don''t believe this is a *feature*
of rspec in the first place, just an not-so-ordinary way to organize
some specs. Any chance of having this work as I expect?
Zach
--
Zach Dennis
http://www.continuousthinking.com
2008 Mar 08
7
ridding away with do_request
...ittle more readability when looking at an individual
"it" behavior on a controller spec. We''ve been keeping the request
helpers as the first things immediately following a controller
specification, ie: "describe SomeController do".
Thoughts?
--
Zach Dennis
http://www.continuousthinking.com
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
2007 Nov 14
0
rspec_on_rails, receive_and_render experiment
A recent exploration on receive_and_render to assist with some common view
spec''ing can be found at
http://www.continuousthinking.com/2007/11/14/rspec_on_rails-render_and_receive_matcher
Suggestions and feedback are welcome. Thanks,
--
Zach Dennis
http://www.continuousthinking.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071114/...
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 Nov 28
6
textmate bundle
...extMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/runner.rb:33:in
`run'' from /Users/zdennis/Library/Application
Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/runner.rb:12:in
`run_file'' from /tmp/temp_textmate.AZtCnz:4
--
Zach Dennis
http://www.continuousthinking.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071128/3b0cb43f/attachment.html
2008 Mar 13
3
Stories (well, integration tests) which aren''t plain text
Hi,
Having just played with getting my first plain text story working, I
like how it all fits together. It worked out nicely.
However, I don''t feel our project needs to have stories as plain text,
in fact it''s a slight hindrance for us. Is there any sensible
mechanism for doing integration testing using rspec without plain text
stories?
Thanks,
Rob
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] =
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
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
2009 Jan 24
4
nokogiri selector help
hiya,
i want the selector that would return a <tr> of a table if any td
contains some text, so i can use it in click_link_within
e.g. When I click the "show" link within the row containing
"user at example.com"
When /^I click the "(.+)" link within the row containing "(.+)"$/ do |
link, text|
selector = ??
click_link_within selector, link
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 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
2009 Feb 08
8
How to upload data using huge .sql file
Hi,
I am using Ruby - 1.8.6 and Rails- 1.2.6.
When I trying to upload data using the .sql file through my code
I got "Mysql::Error: Lost connection to MySQL server during query:
rollback;"
File size is 6 MB.
The code I have used is like:
numberOfRecord =
ActiveRecord::Base.connection.update(File.open(fileName).read)
Please let me know how I upload data using huge .sql file.
If
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 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 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
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 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
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