From 9b85b6d7e04033021a37193f8e7bdb0cd6300a63 Mon Sep 17 00:00:00 2001 From: Matthias Marschall Date: Fri, 29 May 2009 12:07:10 +0200 Subject: [PATCH] added integration tests for all cases of click_button (by id, by html, by value, by alt for buttons and inputs of types image, button and submit) --- .../app/controllers/webrat_controller.rb | 3 + .../rails/app/views/webrat/buttons.html.erb | 11 +++ spec/integration/rails/config/routes.rb | 1 + .../test/integration/button_click_test.rb | 80 +++++++++++++++++++ 4 files changed, 95 insertions(+) create mode 100644 spec/integration/rails/app/views/webrat/buttons.html.erb create mode 100644 spec/integration/rails/test/integration/button_click_test.rb diff --git a/spec/integration/rails/app/controllers/webrat_controller.rb b/spec/integration/rails/app/controllers/webrat_controller.rb index b117ae8..e9f9ad4 100644 --- a/spec/integration/rails/app/controllers/webrat_controller.rb +++ b/spec/integration/rails/app/controllers/webrat_controller.rb @@ -9,6 +9,9 @@ class WebratController < ApplicationController def form end + def buttons + end + def submit render :text => "OK Test Link Text" end diff --git a/spec/integration/rails/app/views/webrat/buttons.html.erb b/spec/integration/rails/app/views/webrat/buttons.html.erb new file mode 100644 index 0000000..e127059 --- /dev/null +++ b/spec/integration/rails/app/views/webrat/buttons.html.erb @@ -0,0 +1,11 @@ +

Webrat Buttons Form

+ +<% form_tag submit_path do %> + + + + + + + +<% end %> \ No newline at end of file diff --git a/spec/integration/rails/config/routes.rb b/spec/integration/rails/config/routes.rb index ced0b4f..e330d3f 100644 --- a/spec/integration/rails/config/routes.rb +++ b/spec/integration/rails/config/routes.rb @@ -9,6 +9,7 @@ ActionController::Routing::Routes.draw do |map| webrat.redirect_to_show_params "/redirect_to_show_params", :action => "redirect_to_show_params" webrat.show_params "/show_params", :action => "show_params" + webrat.buttons "/buttons", :action => "buttons" webrat.root :action => "form" end end diff --git a/spec/integration/rails/test/integration/button_click_test.rb b/spec/integration/rails/test/integration/button_click_test.rb new file mode 100644 index 0000000..3cd0c6c --- /dev/null +++ b/spec/integration/rails/test/integration/button_click_test.rb @@ -0,0 +1,80 @@ +require 'test_helper' + +class ButtonClickTest < ActionController::IntegrationTest + #