You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature: Submitting form
cucumber-nagios should be able to submit forms
Scenario: Visiting home page
When I go to "http://localhost:4567/"
And I fill in "username" with "my user"
And I fill in "password" with "my password"
And I press "Log In"
Then the request should succeed
And I should see "Values: my user, my password"
Output:
Feature: Submitting form
cucumber-nagios should be able to submit forms
Scenario: Visiting home page # features/testing/submitting_forms.feature:4
When I go to "http://localhost:4567/" # features/steps/http_steps.rb:11
And I fill in "username" with "my user" # features/steps/http_steps.rb:23
And I fill in "password" with "my password" # features/steps/http_steps.rb:23
And I press "Log In" # features/steps/http_steps.rb:15
Then the request should succeed # features/steps/http_steps.rb:64
And I should see "Values: my user, my password" # features/steps/http_steps.rb:52
expected: /Values: my user, my password/m
got: " <html>\n <head><title>Testing cucumber</title></head>\n <body>\n Values: , \n </body>\n </html>\n" (using =~)
Diff:
@@ -1,2 +1,7 @@
-/Values: my user, my password/m
+ <html>
+ <head><title>Testing cucumber</title></head>
+ <body>
+ Values: ,
+ </body>
+ </html>
(RSpec::Expectations::ExpectationNotMetError)
./features/steps/http_steps.rb:53:in `/^I should see "(.*)"$/'
features/testing/submitting_forms.feature:10:in `And I should see "Values: my user, my password"'
Failing Scenarios:
cucumber features/testing/submitting_forms.feature:4 # Scenario: Visiting home page
1 scenario (1 failed)
6 steps (1 failed, 5 passed)
0m0.030s
I thought it might be an issue with webrat, but I created a webrat spec to do the same test and it passes:
it"should submit forms"dovisit"http://localhost:4567/"fill_in"username",:with=>"my username"fill_in"password",:with=>"my password"response=click_button"Log In"response.shouldcontain("Values: my username, my password")end
The text was updated successfully, but these errors were encountered:
I had the same issue with submitting forms, googled for while and found workaround - in features/support/env.rb one should have this to have webrat doing right job:
Webrat.configure do |config|
config.mode = :rails
config.open_error_files = false
end
When I fill out a form and submit, it doesn't pass along the form values, it only submits an empty form.
Test server:
Feature:
Output:
This is my Gemfile.lock:
I thought it might be an issue with webrat, but I created a webrat spec to do the same test and it passes:
The text was updated successfully, but these errors were encountered: