cucumber

Ruby gem already activated

How can I de-activate the newer version of cucumber, or get this to work with the earlier version? user$ rake features (in /Users/user/Project) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I "/Library/Ruby/Gems/1.8/gems/cucumber-0.6.1/lib:lib" "/Library/Ruby/Gems/1.8/gems/cucumber- 0.6.1/bin/cucumber" --form...

webrat, rspec, nokogiri segfault

I'm getting a segfault in nokogiri (1.4.1) run (under cucumber 0.6.1/webrat 0.7.0/rspec 1.3.x) response.should have_selector("div", :class => "fieldWithErrors") and the div in the page is actually <div class="fieldWithErrors validation_error"> stuff </div> Everything runs fine if I just test nokogiri against a test document >> req...

Deactivate feature using cucumber

I want to exclude one, already written feature when running all my cucumber features. Why? Because the feature is already implemented (bdd) but I don't have time to implement it now, but I don't wanna loose it. Any help is very appreciated. Code sample: @shallbeexcluded Feature: Exclude me In order to learn more As an stack overf...

Question about Cucumber/Pickle

Hi, I'm trying to get a little more familiarity with Rails / ActiveRecord. In trying to do so I am attempting to use Cucumber to help with some "discovery" tests. I have the following Feature: Describing a task In order to work with tasks As a user I want to be able to know what makes up a task and to improve my understanding ...

Watir - Manual POST request

Hello, Scenario: I have logged into a website, gained cookies etc, got to a particular webpage with a form + hidden fields. I now want to be able to create my own http post with my own hidden form data instead of what is on the webpage and verify the response instead of using the one on the webpage. Reason: Testing against pre-exis...

Cuke4Nuke or SpecFlow?

I am trying to decide if I should use Cuke4Nuke or SpecFlow. What are the pro/cons of each? Opinions on which is better and why. Thanks! ...

Accessing Related Model's not yet mentioned

I have a User factory that references a Company Factory.define :user do |f| f.first_name "John" f.last_name "Smith" f.password "test01" f.password_confirmation {|u| u.password} f.email "[email protected]" f.association :company, :factory => :company end Factory.define :company do |f| f.name "My Company" end The Com...

rails image_submit_tag with cucumber/webrat

I've the following search form with image_submit_tag instead of submit_tag. Now I get the obvious fail when cucumber runs: When I fill in "q" with "sachin" # features/step_definitions/web_steps.rb:33 And I press "submit" # features/s...

Rails/Cucumber/Webrat: redirect_to, flash[:notice] not working

Hello, I'm new to Cucumber and have been stepping through a railscast by Ryan Bates. http://railscasts.com/episodes/155-beginning-with-cucumber Unfortunately my scenario is failing where the railscast passes. Specifically it is failing on the step: Then I should see "New Article Created." I suspect it may have something to do with t...

Facing problem with running configuring environment for cucumber / rspec on ubuntu

I'm trying a basic RSpec / Cucumber tutorial given here However, when I run the command "script/cucumber features", I get the following error and am not able to proceed further. Using the default profile... uninitialized constant Spec::Example (NameError) /home/badal/NetBeansProjects/blog/vendor/rails/activesupport/lib/active_support/d...

Rails: Making Settingslogic work with Cucumber

I can't seem to run Cucumber tests on views that include strings governed by Settingslogic. Scenario: Login as an existing user from homepage Given a user exists And I am on the home page can't convert nil into Hash (ActionView::TemplateError) On line #4 of app/views/home/index.html.haml 1: #greeting ...

How to use bundler gem binaries in path

I just started using bundler for gem packaging in vendor/. The problem is with certain gems (like rspec and cucumber) that have binaries. The binary path that is under my_app/vendor/gems/ruby/1.8/...cucumber-0.6.2/bin/ is not in my path, therefore when I go to run cucumber i get command cannot be found. What is the easiest way to execu...

How do I test ActiveRecord references in Cucumber?

I am trying to create some cucumber features with references to other objects. I am running into some problems when I want to create relationships between objects and run tests on them. I haven't found any samples anywhere else. Let's say I have the following models: class Athlete < ActiveRecord::Base belongs_to :shoe_size validat...

How to test OpenID in rails with cucumber

How to test OpenID in rails with cucumber. Does anybody have real example? For example by using Fakeweb. Thank's ...

Using pickle with cucumber and factory_girl to create associated models and pass parameters through to the nested model

I have the following models: class User < ActiveRecord::Base has_one :profile, :dependent => :destroy def before_create self.profile ||= Profile.new end end class Profile < ActiveRecord::Base belongs_to :user validates_uniqueness_of :name end And I have the following factories: Factory.define :user do |user| ...

RSpec can't find Cucumber gem

When running rspec I get the following error: no such file to load -- cucumber-rails /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `requi...

Cucumber/RSpec testing of improbable errors

I've got a problem testing the following controller code: def publish if @article.publish flash[:notice] = "Article '#{@article.title}' was published." else # This is not tested flash[:error] = "Error publishing article." end redirect_to :action => :index end Where the function publish looks like that: def publish...

FireWatir and jQuery

Hello there, after using this excellent peace of software called FireWatir, I wonder if there is a way to integrate jQuery-selector-magic to my test. My first attempt is to use firewatir's js_eval() method like this require 'rubygems' require 'firewatir' f = FireWatir::Firefox.new f.js_eval("alert(42);") The only thing I get is a ...

Describing Child objects with Cucumber/MongoDB

Ok, total Cucumber newbie here so please be gentle. As a learning Ruby/Cucumber/MongoDB endeavor I'm building a simple contact manager. I have a Person (parent) model and an have been able to write a simple test as follows: Scenario: Show people Given the following person exists | firstname | lastname | | Bob | Jones | W...

Cucumber+Capybara: Problem with a scenario that redirects the browser outside of my app

Given I have a rails app And I'm using cucumber And I'm using capybara And I have an action that results in a redirect_to "http://some.other.domain.com/some_path" When I test this action Then the in-app portion of the test works fine But I see this error: No route matches "/some_path" with {:method=>:get} (ActionController::RoutingError)...