Displaying 20 results from an estimated 10000 matches similar to: "RSpec Post/Get and Sessions in a Story"
2008 Oct 06
10
Uninitialized constant Spec:Story
Hi, I''m fairly new to Rails and v. new to RSpec. Think it looks pretty
useful and so I''m trying it out for the first time. I have installed the
rspec-rails gem and created a simple plain text my_story file and
my_story.rb file along the lines described here -
http://www.tomtenthij.co.uk/2008/1/25/rspec-plain-text-story-runner-on-a-fresh-rails-app.
When I run
2008 Jan 16
1
session data and user stories
hello there,
i have been trying my hand at this rbehave material, specifically in terms
of integration testing a rails application, and i am curious about the most
friendly way to deal with session data.
currently, the only way i have found to simulate a session is to open a
session and refer to everything afterward via the @session variable stored
after open_session. it seems to be workable,
2007 Dec 21
4
StoryRunner docs/guidance
Hi all,
Are there any plans for better documentation for the new StoryRunner
feature? I tried to use it today (with Rails), and had a hard time
getting my head around whether I was doing it "right" and exactly what
things are appropriate to test at that level (this might be exacerbated
by the fact that I''ve never really used integration testing that much).
A full example of
2008 Jun 09
6
Selenium/Watir usage along side Webrat in story testing
This is related to Selenium/Watir usage along side webrat in story
testing.
MHS_Testing and Rspec-ui provide some great help for testing through
frameworks like Selenium/Watir.
But there is something missing, Webrat has changed the landscape
somewhat with Acceptance Tests/Story Driven development.
Now I have a choice:
1. Tests and rails process run as one test process (Webrat)
2. Use
2008 Aug 28
1
rspec story - access session
Very simple, but not googlable: how do I access ''session'' in my story?
In rspec controller specs I could just say session[:user] for example,
but this doesn''t work here.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2008 Mar 20
5
sharing story steps
Hi,
How can I have a common set of steps that all my stories share?
i.e. My stories often start out looking like this:
Given a user Joe
Given a user Jordan
then:
Given("a user $username") do |username|
@users ||= {}
@user_sessions ||= {}
@users[username] = create_user(:username => username)
@user_sessions[username] = login_as(@users[username])
end
I want to share that
2008 Jan 14
6
RSpec stories introduction
I have played a bit with RSpec specs and now want to check out stories. I
note that there is no generator for rspec stories pre se (unless I managed
to miss all references to one ) and that the only directory relating to
stories added by installing rspec is ./stories itself.
The documentation at rspec.info seems to presume a great deal of prior
knowledge. What I am looking for is a guided tour
2007 Nov 13
7
rails story runner returning a nil response code
Has anyone noticed any problems with the Rails story runner returning
a response code of "0" when doing get/post/etc methods? I just
grabbed the latest rails/rspec and just started noticing this problem,
http://pastie.caboo.se/117497
Regular controller specs pass as expected.
--
Josh Knowles
phone: 509-979-1593
email: joshknowles at gmail.com
web: http://joshknowles.com
2008 May 02
2
Return code for running stories
Hi all!
Just wrote a few stories and committed code to a project of mine,
then realized I made a mistake (with the commit, not the code or
tests). It would be nice to put the script
that runs the stories as a pre-commit hook, preventing the commit
from succeeding if the stories fail.
For that, I need to set the right exit code.
In turn, I need to know he result of the tests.
Given the
2008 Jul 11
4
how to debug using rspec stories
Hello. I just started to use rspec stories. I followed the following
tutorial:
http://www.tomtenthij.co.uk/2008/1/25/rspec-plain-text-story-runner-on-a-fresh-rails-app
So I implemented my story and some of the steps are:
(...)
When "user creates a product" do
post "products/new", :name => @name
end
Then "there should be a product named
2007 Nov 13
3
Story problem if parenthesis used in Given, When, Then or And
VERSION: rspec rails plugin current edge version
XP/Cygwin on XP
Hi,
I hit this when trying to use parenthesis in my stories ... (that''ll teach
me!).
If a scenario looks like the following:
Story "User has story with parentheses", %{
As a user
I want parenthesis
So that ... well I just do
}, :type => RailsStory do
Scenario "the Given has parentheses" do
2007 Sep 23
4
Story Runner, autoincrementing
I''ve written a story and I run into a snag.
I''ve written the create_forum method and told it to set the id to 1
but when it creates the forum the id is autoincremented.
My forums table is empty but the id keeps incrementing the newest record on
creation.
When I run the story it comes out as something like 59 which fails my story
because I''m asking it to look at /forums/1
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
2007 Sep 25
7
simple story, extract link
hi,
I just started fooling around with story runner, thought I''d start
with a dead simple scenario:
The first thing I do when describing a site to someone is go to the
home page, and begin exploring public pages from there.
So, that seems like a good first story to spec out.
And I''d really like to extract the actual link from the rendered page
(rather than just
2007 Nov 14
5
ETA to Stories
Hey guys, just poppin in to ask if anyone knows when stories will be
somewhat stable? We''re starting to use integration tests at work,
we''re already using rspec, and I''d like to avoid integration tests if
possible.
Thanks,
Nate "fowlduck" Sutton
2008 May 22
2
Story / Redirection to static html within public
With a rails application I''m trying to access the public/ folder from
within a rspec story.
I have a controller which redirects to:
/public/static_html_page.html
I have a story written using webat.
This story uses the above controller and it expects the redirection.
This story always fails as within the story it cannot follow the
redirection (Always gives a 500 error). It does not
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 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
2007 Oct 05
2
Rails, rSpec edge problems
Hi,
Does the Story Runner work on edge rails? I thought that is what the
example app was using but I am on the latest Rails and latest rSpec
revisions and I am having problems. When I call ''render_template'' in a
story I get the following:
NoMethodError: undefined method `render_template'' for
#<ActionController::Integration::Session:0x327d974>
Do I need to
2008 Jun 02
2
get method under 1.1.4 in Stories is undefined
HI,
After I upgraded to RSpec 1.1.4 (from git), my stories all failed. I
was using Webrat and the first thing I noticed was the ''visits'' method
was gone. I then backtracked to just using ''get'' and got the same
undefined method exception. I confirmed it was still working in 1.1.3
Eventually, I got it to work doing this:
in my first Given:
@app =