Displaying 20 results from an estimated 400 matches similar to: "Specifing methods in a steps_for block"
2007 Dec 20
3
How-to spec this helper method?...
Hey gang,
I have this dead-simple method defined in a helper:
def add_category_link(name)
link_to_function name do |page|
page.insert_html :bottom, :categories, :partial =>
''category'', :object => Category.new
end
end
Where, and mostly how, would I spec this? I haven''t been able to find
how to stub the rjs in a helper spec, so
2007 Dec 22
4
StepGroup ?
Hi,
I have a need for the StepGroup feature in stories but not clear
what''s the current api. Could you provide an example?
In my case I have several scenarios which vary in the Givens, but not
the results. Ideally I''m hoping to achieve something like: (but
anything will do for now :)
Scenario: one
Given something
When he does foo
Then good things should happen
2008 Aug 29
3
BDDish rspecish question
Hey list,
This is a kinda quirky question for this list, but I do think it
belongs here. I''m currently writing an app with users with different
roles. Roles are sequentially so to speak, so role 2 can do everything
role 1 can, and so on.
If I truly test my whole app, I should test all behaviour for each
role, I guess. I could solve that by doing some clever shared steps
and
2007 Dec 14
9
new home for the rspec website
Hi all,
We''ve moved the rspec website to http://rspec.info. We want
http://rspec.org, of course, but someone is squatting on and has yet
to respond to my email :(
The 1.1.0 docs are there. The 1.0.8 docs are still at
http://rspec.rubyforge.org for the time being. We''ll be archiving them
at the new site soon.
This new site is hosted on our shiny new sponsored slice at Engine
2007 Oct 05
20
RSpec Book(s) on the radar
I just found this one: http://tinyurl.com/3c3mfa
David, are there any other RSpec books in the works?
With Regards,
Cody Skidmore
2009 Feb 02
5
[Cucumber] Cucumber and acts_as_xapian
Hey list,
Anyone have experience with acts_as_xapian and Cucumber? I''m
struggling with updating xapian''s index, to actually "find" fluff
that has been indexed..
In a scenario, I''m adding a bunch of articles, and in the actual
search step, I run:
When "I search for \"$query\"" do |query|
%x[rake RAILS_ENV=test xapian:update_index]
2009 Feb 28
7
be_valid (validates_format_of ..., :on => :create)
Greetings,
How to write Example which will check if model''s variable''s
format is valid using :on => :create, like this:
class User < ActiveRecord::Base
...
validates_format_of :email, :with => /.../, :on => :create
...
Using following code is not right:
it "should ..." do
@user = users(:example_user)
@user.email =
2008 Jun 04
8
Why has the --color gone from my life?
Hi all,
Running on OSX 10.5.3, Latest Rspec trunk, Rspec rails trunk, latest
autotest gem and rails 2.1
I''ve lost my colour output in autotest.
rake spec gives colour output, but autotest gives me black and white.
It was working a little bit before, I think I upgraded to the latest
versions of everything to get all the textmate snippets talking and being
friendly to one another again
2009 Jan 17
3
[Cucumber] Struggling with "multiple step definitions"
Hey gang,
I find myself struggling with multiple step definitions in cucumber
all the time. I regularly test the contents of my flash[:notice] in
steps, since I think that''s part of the behaviour of the app. So,
while implementing a new feature, I ran into the following error:
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.1.15/bin/../lib/cucumber/
step_mother.rb:81:in
2008 Jun 14
15
Reusing story snippets
I find myself doing this:
Scenario "logged in user visiting the home page" do
Given "A logged in user" do
a_logged_in_user
end
When "..."
Then "..."
end
The a_logged_in_user method is a helper method in helper.rb which sets
up the state so that the user can browse the website.
Later in the story of course, I can just do ''Given
2009 Feb 04
2
Can cucumber/webrat set a value on a hidden field
I am using auto_complete to provide a list of persons from which the
user can select one. On selection from the auto_complete list, a hidden
field is updated with the id of the selected person. This is all wrapped
in a form, that then can be submitted by the user (by clicking the
provided submit button). On submission, the person (based on the id in
the hidden field) is added to a group.
I assume
2008 May 26
7
Mocking Models in Controller Specs...
I find myself doing this kind of thing a lot in Controller Specs:
@vacancy = mock_model(Vacancy)
@vacancy.stub!(:reference)
@vacancy.stub!(:title)
@vacancy.stub!(:created_at)
@vacancy.stub!(:updated_at)
@vacancy.stub!(:body)
@vacancy.stub!(:contract)
@vacancy.stub!(:location)
@vacancy.stub!(:salary)
@vacancy.stub!(:benefits)
2008 Mar 14
5
Branching scenarios, GivenScenario and database
I''m trying to use stories to drive some high-level design.
I''ve got some branching scenarios where I want to follow a scenario,
to establish a base situation, and then have different scenarios which
''branch'' out from that state, possibly several levels deep.
I asked a bit about this a few days ago, and David pointed out the
rather undocumented GivenScenario
2008 Nov 04
8
Testing a wizard with Cucumber
Assuming you have a multi-step wizard like thing, with lots of different
states and paths through it. What approach would your use to write a feature
for it? What I want to do is do the separate states and then reuse these
things in more complex scenarios that cover paths. For example
Scenario: State A
Given I''m ...
And I''m ...
When I ...
Then I should see
And I at
2010 Jul 06
4
Simple routing problem
I''ve got the following in config\routes.rb:
map.resources :users
In app\views\shared\_menu.erb, I''ve got:
Please sign in <%= link_to
"here", :controller=>"user", :action=>"sign_in" -%>
In app\controllers\users_controller.rb
def sign_in
end
When I run the application, I crash with:
Routing Error
No route matches
2007 Oct 24
3
changes to Story Runner steps
Hi all,
The following only affects people who have bravely begun to experiment
with the 2 day-old plain text story runner and definable groups of
steps.
For those who fit that bill, I just committed a few changes that will
require you to make changes to your code.
The StepMatchers class is now the StepGroup class.
The step_matchers methods on PlainTextStoryRunner and StepGroup is now
just
2008 Mar 11
2
Composed Stories/Scenarios
In using stories, I find myself wanting to build scenarios on top of each other,
For example
I want something like
Scenario: The user logs on
Given a
And b
When c
And d
Then e
And f
Scenario: The user changes his password
Given the user logs on
And g
Then h
In other words, I''d like to write the second scenario starting with
the ''state'' produced by
2007 Nov 15
3
How to Run Rails Stories
I have non non-plain-text story without any steps_for, can it be run?
If so, how?
Thanks,
Nate
2008 Nov 26
5
could one scenario depend on another in cucumber?
I think it is a common test case you would meet. For example, you want
to test a user registry scenario. You write:
Scenario: User Registry
When I dosth
Then I dosth
...
And now business has some changes. Register should have to activate his
account by a secret code sent by mobile phone. So you need to write the
other scenario:
Scenario: User Registry and Account Activation By Mobile
2013 Aug 22
1
duplicated log lines in console
my app seems to be running fine in dev mode ( Rails4, Devise, OAuth2 ,
Doorkeeper ) but looking at the console , I can see all log lines
duplicated ....
where should I look for any tricky bug or missing param ?anyway to get more
info on what''s happening ? thanks a lot for feedback
(ruby-2.0.0@rails40)$ rails server -p 4000
=> Booting WEBrick
=> Rails 4.0.0 application starting