Hi Chris,
Well, I tried the same code that you'd tested and it works for me too in my irb console.
I'm using fakeweb 1.2.6
Let me clear up the scenario.
In my model, I'm using a plugin
validates_uri_existence_of
class Project < ActiveRecord::Base
validates_uri_existence_of :link, :allow_redirect => false
end
So, when I run my cucumber feature:
I get the following error:
======================================================================
Given there exists 20 projects # features/step_definitions/projects_steps.rb:5
Validation failed: Link is giving an error (HTTP code between 400 and 505) or is not responding (ActiveRecord::RecordInvalid)
./features/step_definitions/projects_steps.rb:8
./features/step_definitions/projects_steps.rb:6:in `/^there exists (\d+) projects$/'
features/project.feature:8:in `Given there exists 20 projects'
When I go to projects index page # features/step_definitions/webrat_steps.rb:10
Then I should see "Recent Projects" # features/step_definitions/webrat_steps.rb:93
Failing Scenarios:
cucumber features/project.feature:7 # Scenario: Lists all the projects with pagination
=====================================================================
The step definition will execute the Factory(:project)
I'm confused. When I register the uri with Fakeweb for individual url manually, it works as expected but doesn't if I use the regex style?
Sachin Sagar Rai (aka - millisami)
<%= Freelance Web Designer#Developer %>
a.g.f.n. (a guy from Nepal)
http://www.tfm.com.nphttp://www.welcometonewnepal.com9851065264 /
9803857018