Topic: Problems with capybara and cucumber

Hi folks,

i'm starting with BDD and i'm using rails3, spec, capybara and cucumber... but the problem is.. after downloading all the gems and running: script/rails generate rspec:install and the cucumber:install --rspec --capybara
there is a features directory but for example the paths.rb is missing... also the default step definitions are missing... and also there is no generator for generating features....

so i search google but i don't find how to make capybara's default step definitions work... for example i found on the internet that there should be for example such a step definitions

Given /^(?:|I )am on (.+)$/ do |page_name|
  visit path_to(page_name)
end

and basically there should be a paths.rb with stuff in it where i should add something like

when /task index page/
  tasks_path()

but as i told you there is no paths.rb... so i created it myself and put

def path_to(page_name)
  case page_name
    when /task index page/
      tasks_path()
  end
end

into it... but still the step is shown as undefined.. that means that there are no predefined step definitions (loaded)?

so am i missing an important point or what is up?

could please someone enlighten me :-)

Thank and regards
sulo

Re: Problems with capybara and cucumber

I just started playing with examples in Rails 3 in Action and encountered the same problem.
It looks like cucumber-rails changed their implementations from 1.0.6 to 1.1.0.
https://github.com/cucumber/cucumber-ra … History.md
So, it no longer generates all those helpful files we used to have.
If you really want those files back, install the version 1.0.6.
Then, you should be ready to go.
If you want to follow the current philosophy that cucumber-rails team has decided, you should follow their recommended ways.