cucumber

undefined method `find_link' for #<Cucumber::Rails::World:0x818e02e8> (NoMethodError)

Rspec obviously hates me. I kinda hate him back. #features/step_definitions/custom_steps.rb Then /^I should see the link "([^\"]*)"$/ do |linked_text| find_link(linked_text) end #link.feature Then I should see the link "foo" From terminal: undefined method `find_link' for #<Cucumber::Rails::World:0x818e02e8> (NoMethodError) ./featu...

Error at the end of a capybara autotest... every time...

With autospec / cucumber / capybara running my feature tests I get this line even after going green: (eval):1:in `initialize': can't convert String into Integer (TypeError) Anyone know what this is? I thought it was me, then heard another dev was seeing it to, and when googling I see it in the screen logs on various issues at the capy...

How can I test different environments (e.g. development|test|production) in Cucumber?

Take this scenario. I have a Google Analytics tracking code, and I only want it to show up in Production mode. So I might have two scenarios like this: Scenario: Don't embed tracking code in development or test mode Given the app is not in production mode When I go home Then I should really not see the tracking code Scenario: Emb...

Please help me setting up my Rails3 app testing tools

Hello, I'm starting a new rails 3 application, and I want it to be tested the better I can. This application is eavily based on plugins (wich will become gems later). One of this gem will be a proxy which talk with an API and outputs formatted data. Few plugins will process data sent by this proxy My questions : Should I use cucum...

Cucumber, Webrat, Mechanize: can't access "response" variable

I am trying to use Cucumber+webrat+mechanize to test some web pages. In a simple example, I set up something like ... And I goto Home Then I should see "Welcome" And I have the following in my step file: Then /^I should see "([^\"]*)"$/ do |text| response_body.should contain(text) end I get an error, complaining that there is no...

Using Cucumber/Capybara in Rails 3, how do I set a custom User-Agent string?

In my Rails 3 app, I have different layouts for iPhone vs desktop browsers. I'm trying to test the iPhone layout using Cucumber/Capybara. So far, all my attempts at setting an iPhone User-Agent string in the request's HTTP header have failed. I have followed the Testing custom headers and ssl with Cucumber and Capybara tutorial but it d...

TDD vs BDD in Rails 3?

Im a beginner when it comes to TDD and BDD. This is what I know: To use TDD in Rails I use it's built-in unit-, functional and integration tests. To use BDD in Rails I use Cucumber. So are these two different techniques that shouldn't be used together? If I use TDD, then I shouldn't use BBD/Cucumber and vice versa? Please enlighten...

Testing Authlogic Remember Me with Cucumber

Has anyone tried to test the Authlogic "Remember Me" functionality with Cucumber? I am not sure how to get webrat to "close a browser" to test persistence. Only thought is maybe it requires selenium? Is there a way to do without? ...

How to put capybara output html to a specific folder?

When I use the "Show me the page" step, with Capybara / Cucumber, can I control where the files get output? I can't seem to find the config for this, and my google fu is failing me. Right now it appears that by default they go to the root of my rails folder and clutter up things there. ...

Is there a nice way to share your cucumber features with your clients?

I LOVE cucumber, my clients love it too. As far as I know currently there isn't a nice way to share your features with your clients. Us nerds have TextMate or NetBean bundles that give us nice syntax highlighting -- my clients not so much. What I would love is to be have something hosted at features.myclientsapp.com that would be a or...

Parse issues when trying to use "Examples" section in Cucumber feature

No luck in googling on this error message features/manage_hand_evaluator.feature: Parse error at features/manage_hand_evaluator.feature:21. Found examples when expecting one of: comment, py_string, row, scenario, scenario_outline, step, tag. (Current state: step). (Gherkin::Parser::ParseError) Here's the setup I have for Examples secti...

Get Cucumber to use the test environment in Sinatra

This seems right, but doesn't seem to work. env.rb: class MyWorld set :environment, :test end app.rb: configure :development do DataMapper::setup(:default, "sqlite3://development.sqlite3") end configure :test do DataMapper::setup(:default, "sqlite3://test.sqlite3") end It keeps using the development environment. Am I missin...

"ERROR Errno::EPIPE: Broken pipe" with Culerity

Hi, I've recently installed culerity to use on top of cucumber. But when I run my cucumber specs, they turn red (they were all green before). The errors I get have this form: Celerity::Exception::NavigationException: com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 500 Internal Server Error for http://localhost:3...

Cucumber::ArityMismatchError error after Transform

my step definition Transform /^user "([^"]*)"$/ do | email | Person.find_by_email(email) end Given /^login as (user "([^"]*)")$/ do | user | login_as email end my feature login as user "[email protected]" I am getting this error And user "[email protected]" has security role "contact" # features/step_definitions/security_role_...

raise I18n exceptions from within cucumber tests (rails 3)

I'am currently trying to get i18n into our rails application. I use cucumber for integration testing and test_unit for everything else. After the initial translation and "refactoring" the locale file, I have a few missing translations in my app, due to changed translation keys. What I want now, is that cucumber reports all missing tran...

Cycling "Given" information to a "When" action in Cucumber

I am trying to create a quizzing style skill drilling site and use Cucumber to drive the testing. As a rough estimate pretend I am presenting the user with two numbers, and asking the user to click a button representing their difference. Two obvious scenarios would be: Scenario: Difference drill, correct answer Given I am on the diffe...

How can I use Cucumber to test Devise's Rememberable functionality?

I'd like to have a Cucumber feature testing the rememberable functionality of devise (a remember me cookie). It is easy to check the remember me check box using capybara but how should I simulate a user returning to the site after closing their window? ...

related objects in steps with cucumber/pickle

Hi, it would be great if somebody could help me with the cucumber/pickle syntax on creating related objects and assert them. How can I get references in my cucumber syntax... Something Like For example: creating a blog post with a certain title with 3 comments And then assert this post and the related comments... Is this with object ...

Using Cucumber to test my OAuth provider in Rails

I have a rails site that allows authentication through OAuth (I use Restful Authentication and the Rails OAuth Plugin). To make sure that it worked, I made a quick site to act as an OAuth consumer. However, I want the testing to be self-contained in Cucumber features. Ideally, this would use Webrat so that Cucumber could correctly m...

Cucumber can't find routes? This is potentially a big newb question.

Rails3 app with Rspec2 and Cucumber Cucumber Given /^that a user is logged in$/ do current_user = User.first render new_user_post_path(current_user) end Routes.rb map.resources :users do |users| users.resources :posts, :collection => {:view => :get} end posts_controller_spec describe PostsController do describe "#new" do ...