Skip to content
This repository
Browse code

fixed activesupport version dependency

updated example page mixins for github site modifications
  • Loading branch information...
commit bdc6159aeaf84b6f282a70610a9d41b72f6272e0 1 parent f21030e
authored September 02, 2010
6  Rakefile
@@ -17,7 +17,7 @@ begin
17 17
     gem.add_development_dependency "metric_fu", ">= 1.3.0"
18 18
     # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
19 19
     gem.add_dependency "nokogiri", ">= 1.4.1"
20  
-    gem.add_dependency "activesupport", ">= 2.3.5"
  20
+    gem.add_dependency "activesupport", "~> 2.3.5"
21 21
     gem.add_dependency "tilt", ">= 1.0.1"
22 22
   end
23 23
   Jeweler::GemcutterTasks.new
@@ -34,10 +34,10 @@ Spec::Rake::SpecTask.new(:spec) do |spec|
34 34
 end
35 35
 
36 36
 Spec::Rake::SpecTask.new(:rcov) do |spec|
37  
-  spec.libs << 'lib' << 'spec'
  37
+  spec.libs << 'lib/gizmo'
38 38
   spec.pattern = 'spec/**/*_spec.rb'
39 39
   spec.rcov = true
40  
-  spec.rcov_opts = ['--failure-threshold', 100, '--exclude', 'features']
  40
+  spec.rcov_opts = ['--failure-threshold', 100, '--exclude', 'features,.gems']
41 41
 end
42 42
 
43 43
 task :spec => :check_dependencies
13  features/support/pages/page_with_github_search.rb
@@ -3,13 +3,13 @@ module PageWithGithubSearch
3 3
   include Gizmo::PageMixin
4 4
 
5 5
   def valid?
6  
-    has_selector?("div.search")
  6
+    has_selector?("form[action='/search']")
7 7
   end
8 8
 
9 9
   def search_form
10 10
     element_struct do |form|
11  
-      form.container = @document.css("div.search")
12  
-      form.element = container= form.container.css("form")
  11
+      form.container = @document.css("form[action='/search']")
  12
+      form.element = container = form.container
13 13
       form.input = container.css("input[name=q]")
14 14
       form.submit = container.css("input[alt=search]")
15 15
     end
@@ -24,9 +24,14 @@ def search_form
24 24
     locate(element).click
25 25
   end
26 26
   
  27
+  define_action :submit_form do
  28
+    evaluate_script("document.forms[0].submit()")
  29
+  end
  30
+  
27 31
   define_action :search do |query|
28 32
     perform :enter_search_query, query
29  
-    perform :click_element, search_form.submit
  33
+    # perform :click_element, search_form.submit
  34
+    perform :submit_form
30 35
   end
31 36
   
32 37
   private
2  gizmo.gemspec
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9 9
 
10 10
   s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11 11
   s.authors = ["Luke Cunningham", "Steven Holloway", "Sam Weller"]
12  
-  s.date = %q{2010-08-10}
  12
+  s.date = %q{2010-09-02}
13 13
   s.default_executable = %q{gizmo}
14 14
   s.description = %q{gizmo is a simple page model testing framework used and sponsored by 'realestate.com.au'. The aim of the project is to DRY up your testing assertions by abstracting code that defines your page resulting in a consistent, easy to maintain test suit}
15 15
   s.email = %q{luke@icaruswings.com}
2  lib/gizmo.rb
... ...
@@ -1,5 +1,7 @@
1 1
 require 'rubygems'
  2
+
2 3
 require 'active_support'
  4
+
3 5
 require 'nokogiri'
4 6
 require 'tilt'
5 7
 require 'term/ansicolor'

0 notes on commit bdc6159

Please sign in to comment.
Something went wrong with that request. Please try again.