When using Cucumber and Webrat in a ruby on rails 3 application you see the error:
undefined method `visit' for #<:rails::world:0x..fdb6d16e4> (NoMethodError) and your scenario fails.
Replace the line:
config.mode = :rails
with the line:
config.mode = :rack
in the Webrat.configure block, in your
You would like to start using BDD in a new Ruby on Rails 3 application, and would like to install Webrat, Cucumber and RSpec to your project.
Follow the steps below (taken from the RSpec Book), for creating a new Rails 3 application and adding the necessary testing frameworks:
- Create your new ruby on rails application:
rails new my_app
- Go to your new application directory:
- Edit your Gemfile to include the following:
group :development, :test do
gem "rspec-rails", ">= 2.0.0"
gem "cucumber-rails", ">= 0.3.2"
gem "webrat", ">= 0.7.2"
- Use bundler to install all the gems and dependencies:
- Install the rspec files:
script/rails generate rspec:install
- Install the cucumber files:
script/rails generate cucumber:install
- Run the following and you shouldn’t be seeing any errors:
According to a dreamhost post here, you should be upgrading your WordPress installation as soon as possible.
You would like to host a new git repository in Gitorius.
Assuming that you have created your initial ruby on rails application, and you have git installed, you can follow the steps below:
- Create a new account in Gitorious
- Copy your public ssh key (usually in ~./ssh) to your new account in Gitorius
- Create a new project in Gitorius (ie My Project)
- Add a new repository in Gitorius (ie My Git Repository)
- On your local development host initialise the git repository in your project’s directory:
- Add your remote hosting repository:
git remote add origin firstname.lastname@example.org:my-project-name/my-git-repo.git
- Add your project files:
git add .
- Do your initial commit:
git commit -m "Initial commit"
- Push your project to the Gitorious repository:
git push origin master