webrat

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

拥有回忆 提交于 2020-01-11 13:28:07
问题 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

selecting page elements with webrat

筅森魡賤 提交于 2020-01-07 04:34:12
问题 There is a list of products (html table). Each row has got product name and ends with 'add to cart' button. How to add 2 'coffee' and 3 'tea' in the cart from webrat? Corresponding html: <tr class="odd"> <td><img src="/images/menu_items_images/7/PICT0020_thumb.jpg" /></td> <td>cofee</td> <td>americano</td> <td>1.0</td> <td><form action="/cart/add_item/7" method="post" onsubmit="$.ajax({data:$.param($(this).serializeArray()) + '&authenticity_token=' + encodeURIComponent(

Acceptance testing of sinatra app using webrat fails

痴心易碎 提交于 2019-12-25 05:16:27
问题 I am trying to test a ruby authentication app using minitest and webrat but get errors. Tests like visit '/' fail with an error Status 200 expected but was 404. Tests containing code like fill_in :email, :with => "first@company.com" fail with error Could not find field: :email . I read several sinatra, testing and webrat documents and forums. Some of them were old and suggested stuff like Sinatra::Default, but github.com/brynary/webrat/wiki/sinatra, Building a Sinatra App Driven By Webrat

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

為{幸葍}努か 提交于 2019-12-19 11:53:17
问题 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

Session variables with Cucumber Stories

风流意气都作罢 提交于 2019-12-18 10:24:12
问题 I am working on some Cucumber stories for a 'sign up' application which has a number of steps. Rather then writing a Huuuuuuuge story to cover all the steps at once, which would be bad , I'd rather work through each action in the controller like a regular user. My problem here is that I am storing the account ID which is created in the first step as a session variable, so when step 2, step 3 etc are visited the existing registration data is loaded. I'm aware of being able to access controller

Webrat and Rails: Using assert_contain after click_button gives me “You are being redirected”

若如初见. 提交于 2019-12-18 01:19:11
问题 I'm writing an integration test for a rails application using webrat. After filling out a form, the user presses submit and an account is created. click_button "Submit" assert_contain "Your Account Has Been Created" However, the test fails: expected the following element's content to include "Your Account Has Been Created": You are being redirected. <false> is not true. Normally to follow a redirect I would use post_via_redirect, but from just looking at Webrat's examples, click_button

Can't build gem — native extension build fails — can you see why?

不问归期 提交于 2019-12-13 02:25:26
问题 I can't figure out what is going wrong here -- any ideas?? I'm running on a Ubuntu 8.04 LTS, and have installed libxml2 and libxslt from these instructions: http://www.techsww.com/tutorials/libraries/libxml/installation/installing_libxml_on_ubuntu_linux.php http://www.techsww.com/tutorials/libraries/libxslt/installation/installing_libxslt_on_ubuntu_linux.php However, I installed the latest versions: libxslt-1.1.24 libxml2-2.7.3 The install was uneventful -------------------- I set LD_LIBRARY

How to handle cookies when testing with Webrat?

▼魔方 西西 提交于 2019-12-13 01:27:06
问题 I'm writing Cucumber tests for a Sinatra based application using Webrat. For some tests I need to implement a scenario like Given I am logged in as admin When I am visiting "/" Then I should see "Settings" I define steps like this: Given /^I am logged in as "(.+)"$/ do |user| visit "/login" fill_in "login", :with => user fill_in "password", :with => "123456" click_button "Login" end When /^I am viewing "(.+)"$/ do |url| visit(url) end Then /^I should see "(.+)"$/ do |text| response_body

Error in webrat installation

强颜欢笑 提交于 2019-12-11 19:32:27
问题 I'm getting the following error when I'm trying to install webrat in my OS X, please suggest me how can i solve this problem. ERROR: Error installing webrat: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/nokogiri-1.4.0 for inspection.

Installing hpricot for JRuby

寵の児 提交于 2019-12-11 06:42:44
问题 I'm trying to look at cucumber for Jruby on Rails. One of the pre-requesites is webrat which has as pre-requisite hpricot. I've installed the gem with hpricot using: gem install hpricot --source http://code.whytheluckystiff.net --version 0.6.1 --platform java This installs the java version of hpricot. I add the hpricot_scan.jar to the CLASSPATH but when I run: cucumber features -n I get the following output: HpricotScanService.java:931:in `hpricot_scan': java.lang.NoSuchMethodError: org.jruby