From a86e82271cd6252229ad545b3a2aaab4efbbe9ee Mon Sep 17 00:00:00 2001 From: Bert Hajee Date: Wed, 18 Sep 2013 22:51:30 +0200 Subject: [PATCH] Updated to V1.04 --- CHANGES.md | 3 ++ Gemfile.lock | 28 ++++++++++--------- lib/page_record/base.rb | 2 +- lib/page_record/version.rb | 2 +- .../views/page-one-record-with-selector.erb | 8 +++--- ...e-with-duplicate-records-with-selector.erb | 3 ++ .../page-without-records-with-selector.erb | 8 ++++-- 7 files changed, 32 insertions(+), 22 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e92e993..82244bc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ #Changes +##V1.0.4 +* Changed behaviour of selector. A selector and a data-record-id on the same HTML element are no longer allowed + ##V1.0.3 * Added support for getting the Capybara element of a record. * #id now returns an integer diff --git a/Gemfile.lock b/Gemfile.lock index e65c75c..e37f864 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - page_record (1.0.3) + page_record (1.0.4) activemodel activesupport capybara (~> 2.1.0) @@ -31,7 +31,7 @@ GEM thread_safe (~> 0.1) tzinfo (~> 0.3.37) arel (4.0.0) - atomic (1.1.13) + atomic (1.1.14) builder (3.1.4) capybara (2.1.0) mime-types (>= 1.16) @@ -40,37 +40,36 @@ GEM rack-test (>= 0.5.4) xpath (~> 2.0) coderay (1.0.9) - colorize (0.5.8) - coveralls (0.6.7) - colorize + coveralls (0.7.0) multi_json (~> 1.3) rest-client simplecov (>= 0.7) + term-ansicolor thor diff-lcs (1.2.4) erubis (2.7.0) ffi (1.9.0) formatador (0.2.4) - guard (1.8.2) + guard (1.8.3) formatador (>= 0.2.4) - listen (>= 1.0.0) + listen (~> 1.3) lumberjack (>= 1.0.2) pry (>= 0.9.10) thor (>= 0.14.6) - guard-rspec (3.0.2) + guard-rspec (3.0.3) guard (>= 1.8) rspec (~> 2.13) i18n (0.6.5) - listen (1.3.0) + listen (1.3.1) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) rb-kqueue (>= 0.2) lumberjack (1.0.4) method_source (0.8.2) - mime-types (1.24) + mime-types (1.25) mini_portile (0.5.1) minitest (4.7.5) - multi_json (1.7.9) + multi_json (1.8.0) nokogiri (1.6.0) mini_portile (~> 0.5.0) pry (0.9.12.2) @@ -89,7 +88,7 @@ GEM thor (>= 0.18.1, < 2.0) rake (10.1.0) rb-fsevent (0.9.3) - rb-inotify (0.9.1) + rb-inotify (0.9.2) ffi (>= 0.5.0) rb-kqueue (0.2.0) ffi (>= 0.5.0) @@ -120,10 +119,13 @@ GEM rack-protection (~> 1.4) tilt (~> 1.3, >= 1.3.4) slop (3.4.6) + term-ansicolor (1.2.2) + tins (~> 0.8) thor (0.18.1) - thread_safe (0.1.2) + thread_safe (0.1.3) atomic tilt (1.4.1) + tins (0.9.0) tzinfo (0.3.37) xpath (2.0.0) nokogiri (~> 1.3) diff --git a/lib/page_record/base.rb b/lib/page_record/base.rb index 0ae2f54..a51f2ff 100644 --- a/lib/page_record/base.rb +++ b/lib/page_record/base.rb @@ -271,7 +271,7 @@ def self.context_for_selector(selector) page else begin - page.find(selector).find(:xpath, '..') + page.find(selector) rescue Capybara::Ambiguous raise MultipleRecords, "Found multiple HTML segments with selector #{selector} on page" rescue Capybara::ElementNotFound diff --git a/lib/page_record/version.rb b/lib/page_record/version.rb index 9ec3488..1f54fec 100644 --- a/lib/page_record/version.rb +++ b/lib/page_record/version.rb @@ -1,3 +1,3 @@ module PageRecord - VERSION = '1.0.3' + VERSION = '1.0.4' end diff --git a/spec/support/views/page-one-record-with-selector.erb b/spec/support/views/page-one-record-with-selector.erb index 634b0fd..93df3ad 100644 --- a/spec/support/views/page-one-record-with-selector.erb +++ b/spec/support/views/page-one-record-with-selector.erb @@ -1,10 +1,10 @@ -
-
+
+
Ajax
-
-
+
+
Ajax
\ No newline at end of file diff --git a/spec/support/views/page-with-duplicate-records-with-selector.erb b/spec/support/views/page-with-duplicate-records-with-selector.erb index 5fd5622..8941511 100644 --- a/spec/support/views/page-with-duplicate-records-with-selector.erb +++ b/spec/support/views/page-with-duplicate-records-with-selector.erb @@ -8,4 +8,7 @@ Ajax + + Ajax + diff --git a/spec/support/views/page-without-records-with-selector.erb b/spec/support/views/page-without-records-with-selector.erb index cca4e21..25b1be1 100644 --- a/spec/support/views/page-without-records-with-selector.erb +++ b/spec/support/views/page-without-records-with-selector.erb @@ -1,3 +1,5 @@ -
-
Ajax
-
+
+
+
Ajax
+
+
\ No newline at end of file