I'm having a lot of trouble trying to define a mock for a rails models on cucumber. It seems like the method is creating a bunch of message expectations and i keep getting errors like these:
Given I have only a product named "Sushi de Pato" # features/step_definitions/product_
steps.rb:19
unexpected invocation: #<Mock:ProductCate...
I'm building out a medium-sized application using Sinatra and all was well when I had a single app.rb file and I followed Aslak's guidance up on Github:
http://wiki.github.com/aslakhellesoy/cucumber/sinatra
As the app grew a bit larger and the app.rb file started to bulge, I refactored out a lot of of the bits into "middleware" style m...
At the beginning this worked fine: $ rake cucumber:all
But then $ script/plugin install git://github.com/bmabey/email-spec.git
remote: Counting objects: 162, done.
remote: Compressing objects: 100% (130/130), done.
remote: Total 162 (delta 18), reused 79 (delta 13)
Receiving objects: 100% (162/162), 127.65 KiB | 15 KiB/s, done.
Resolvi...
Hi!
I need to test an autocomplete field with cucumber. How can I do that? I tried
Scenario: Using Autocomplete
Given I am on the home page
And there are the following users:
|id |name |
|1 |foo |
When I fill in "name" with "f"
Then I should see "foo"
But then it fails because expected the following eleme...
I'm new to Watir and I've having a little trouble getting logged in in my tests. I use authlogic as my authentication method of choice. When a User registers, they are sent an email with a confirmation link. Clicking this link confirms their account and they can then login.
The issue I'm having is how do I confirm the User when using Wa...
Hi there,
I'm trying to run cucumber features with factory girl factories on a fresh Rails 3 application.
Here is my Gemfile:
source "http://gemcutter.org"
gem "rails", "3.0.0.beta"
gem "pg"
gem "factory_girl", :git => "git://github.com/thoughtbot/factory_girl.git", :branch => "rails3"
gem "rspec-rails", ">= 2.0.0.beta.4"
gem "capybar...
I have an application using the SentientUser gem to provide the current user to my models. On top of that I'm using default scoping to ensure that a user can only ever access data that they own. So a typical model for me looks something like this:
class Location < ActiveRecord::Base
validates_presence_of :name, :time_zone, :address
...
I'm having trouble implementing this step:
Given "I am logged in as a Facebook user" do
end
The best suggestions I can find on the web (http://opensoul.org/2009/3/6/testing-facebook-with-cucumber) do not seem to be using Authlogic for authentication.
Can someone with the Cucumber/Authlogic_facebook_connect/Authlogic combo post thei...
I'm looking at a cucumber test suite that is somewhat brittle right now; many small steps, and no knowledge of the page itself.
I'd like to factor out the logic involved in the step definitions inside a series of Selenium PageObjects. As seen here.
However, because I'm using Webrat and not Selenium, everything has to go through the We...
According to rake routes, there's the same path for getting an index of objects as there is for creating a new object:
cars GET /cars(.:format) {:controller=>"plugs", :what=>"car", :action=>"index"}
POST /cars(.:format) {:controller=>"plugs", :what=>"car", :action=>"create"}
Obviously, the HTTP verb is what distinguish...
I recently installed a fresh development setup on my laptop and now notice that my instances of spork take several minutes to start up. This is also most likely of the RSpec and Cucumber tests start up times running super slow.
I ran in diagnostic mode with the -d flag and received the output below. Anyone have a clue why this is sudd...
Just updated my cucumber gems on my system and have run into an issue with running my tagged cucumber features. The "cucumber" command no longer works on my command line.
-bash: cucumber: command not found
Initial thought was that my $PATH wasn't set up in my bash_login properly. All seems correct here though, i think:
echo $PATH
/op...
Is there a cucumber command that will print out just the feature info and the scenario names?
I recently began a project and want to print out the cucumber features and scenarios I wrote to describe the scope of the project and get it confirmed with the client.
...
I'm new to Ruby, and I've been trying to learn Rake, RSpec, and Cucumber. I found some code that will help me test my Rake tasks, but I'm having trouble getting it to work. I was told here: http://blog.codahale.com/2007/12/20/rake-vs-rspec-fight/to drop this:
def describe_rake_task(task_name, filename, &block)
require "rake"
des...
I have recently updated the Cucumber gems ('cucumber' and 'cucumber-rails') on my machine and have run into a couple of issues. The one i am currently fighting is that none of the defined steps for my features are being automatically loaded by Cucumber. This results in my command line telling me i "can implement step definitions for unde...
For several of my cuke scenarios, I want to POST the user to a page with an object in the params, so that Rails will make a new object in the database. Is there a convenient way to send a POST+params to an action (either using something in cucumber or rails) or do I have to write my own function using Net::Http?
...
I'm using cucumber with webrat, and I am just starting to integrate culerity/celerity. My webrat login steps have been working great, and I have them as a Background for many of my scenarios. The problem is that although I can log in successfully via webrat, my celerity specific step definitions don't seem to recognize that. I can check ...
I have a webpage that has a form button on it called "delete", and a cuke scenario that has the line:
And I should see "delete"
When I run the scenario, I get this error:
expected the following element's content to include "delete"
...and it dumps the webrat page to stdout and the "delete" is, in fact, not there. So far so good. Ho...
The cucumber test first makes an entry in the database and posts a form to a second server. This second server does some processing in background and then hits the first app (where the test is being run) with some data that the cucumber test needs to know about.
I've tried running the main server via script/server and script/server -e ...
I'm using selenium_client with cucumber, webrat + IE
As you'd expect, Firefox works fine. I've tried the following:
selenium.is_visible("css=#flash .flash_notice")
selenium.is_visible("xpath=//*[@id='flash']/*[@class='flash_notice]")
selenium.is_visible("xpath=//*[@id='flash']/*[contains(@class,'flash_notice]')")
both cannot find the ...