webrat

Rails, RSpec and Webrat: Expected output matches rendered output but still getting error in view spec

不想你离开。 提交于 2019-12-05 01:47:40
问题 I've just gotten started using BDD with RSpec/Cucumber/Webrat and Rails and I've run into some frustration trying to get my view spec to pass. First of all, I am running Ruby 1.9.1p129 with Rails 2.3.2, RSpec and RSpec-Rails 1.2.6, Cucumber 0.3.11, and Webrat 0.4.4. Here is the code relevant to my question config/routes.rb: map.b_posts 'backend/posts', :controller => 'backend/posts', :action => 'backend_index', :conditions => { :method => :get } map.connect 'backend/posts', :controller =>

Undefined webrat methods in cucumber step_definitions

一曲冷凌霜 提交于 2019-12-04 18:55:08
问题 When i run my features i get this error: undefined method `visit' for #<Cucumber::Rails::World:0x81b17ac0> (NoMethodError) This is the relevant part of my Gemfile . group :development, :test do gem "rspec-rails", ">= 2.0.0.beta.19" gem "cucumber" gem "cucumber-rails", ">= 0.3.2" gem 'webrat', ">= 0.7.2.beta.1" end The relating step_definition (though i don't think it's important) When /^I create a movie Caddyshack in the Comendy genre$/ do visit movies_path click_link "Add Movie" fill_in

Rspec integration tests without cucumber?

别说谁变了你拦得住时间么 提交于 2019-12-04 10:28:55
问题 Is there a way to do integration tests with Rspec without using Cucumber? I prefer using just plain old Webrat. Thanks. 回答1: The latest version of RSpec-Rails (1.2.7) now has integration support. Upgrade then start adding specs to spec/integration or use the 'integration_spec' generator. Configure Webrat in spec/spec_helper.rb and you're set! 回答2: We've recently started using RSpec with Capybara over Cucumber. Here is a "beginners" blog post I recently wrote on using RSpec integration tests

Rails, RSpec and Webrat: Expected output matches rendered output but still getting error in view spec

余生长醉 提交于 2019-12-03 16:16:30
I've just gotten started using BDD with RSpec/Cucumber/Webrat and Rails and I've run into some frustration trying to get my view spec to pass. First of all, I am running Ruby 1.9.1p129 with Rails 2.3.2, RSpec and RSpec-Rails 1.2.6, Cucumber 0.3.11, and Webrat 0.4.4. Here is the code relevant to my question config/routes.rb: map.b_posts 'backend/posts', :controller => 'backend/posts', :action => 'backend_index', :conditions => { :method => :get } map.connect 'backend/posts', :controller => 'backend/posts', :action => 'create', :conditions => { :method => :post } views/backend/posts/create.html

Rspec integration tests without cucumber?

末鹿安然 提交于 2019-12-03 05:56:21
Is there a way to do integration tests with Rspec without using Cucumber? I prefer using just plain old Webrat. Thanks. The latest version of RSpec-Rails (1.2.7) now has integration support. Upgrade then start adding specs to spec/integration or use the 'integration_spec' generator. Configure Webrat in spec/spec_helper.rb and you're set! harlow We've recently started using RSpec with Capybara over Cucumber. Here is a "beginners" blog post I recently wrote on using RSpec integration tests without cucumber. End-to-end testing with RSpec integration tests and Capybara Let me know if you have any

authlogic flash[:notice] does not show up in cucumber webrat step

折月煮酒 提交于 2019-12-02 10:22:49
I am running BDD steps with cucumber to implement my autlogic login behavior. Scenario: log in Given a registered user: "test@test.com" with password: "p@ssword" exists And I am on the homepage When I follow "Log in" And I fill in "Username" with "test@test.com" And I fill in "Password" with "p@ssword" And I open the page And I press "Login" And I open the page Then I should see "Login successful!" And I should see "Logout" this is my scenario and when I hit Then I should see "Login successful!" my cucumber step fails but only in webrat. I debugged with launchy and when the web-page appeard

Cucumber: selecting an element from a table for deletion or addition

帅比萌擦擦* 提交于 2019-12-01 22:43:52
问题 I have the following table in an application I am developing using ruby on rails: I want to create a test in cucumber where I select a user from the table and delete it or edit it. I don't know what is the step definition for that. I'd like to be able to do something like: Feature: User Manegement In order to manage users As an admin I want to see a users list and change user properties Background: Given the following activated users exists | name | email | | Alice Hunter | alice.hunter

Cucumber: selecting an element from a table for deletion or addition

烈酒焚心 提交于 2019-12-01 18:57:02
I have the following table in an application I am developing using ruby on rails: I want to create a test in cucumber where I select a user from the table and delete it or edit it. I don't know what is the step definition for that. I'd like to be able to do something like: Feature: User Manegement In order to manage users As an admin I want to see a users list and change user properties Background: Given the following activated users exists | name | email | | Alice Hunter | alice.hunter@example.com | | Bob Hunter | bob.hunter@example.com | And the following user records | name | email | | Jonh

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

北城以北 提交于 2019-12-01 14:38:19
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 the differing versions of the gems we are using, currently I have the latest of each. It gives me the following error: *Then I should see "New Article Created." expected the following element's content to include "New Article Created.": Title Content (Spec::Expectations:

Cucumber + Webrat + Selenium guide

筅森魡賤 提交于 2019-11-30 02:41:50
I have been using Cucumber and Webrat for a while. I now need to start writing behaviour that involve AJAX interactions so I was thinking to use the Selenium adapter for Webrat. Can anyone point out a easy and updated step-by-step guide for installing and configuring selenium+webrat+cucumber? I would like to be able to mix javascript scenario with non-javascript scenarios. Jirapong I'm using Selenium with rspec on my project and generate code from a custom formatter for Selenium IDE. There is many selenium for rails but i success using Selenium-RC http://seleniumhq.org/download/ , so download