Skip to content

Commit

Permalink
Updated to V1.04
Browse files Browse the repository at this point in the history
  • Loading branch information
Bert Hajee authored and Bert Hajee committed Sep 18, 2013
1 parent 23a07f0 commit a86e822
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 22 deletions.
3 changes: 3 additions & 0 deletions 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
Expand Down
28 changes: 15 additions & 13 deletions 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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/page_record/base.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/page_record/version.rb
@@ -1,3 +1,3 @@
module PageRecord
VERSION = '1.0.3'
VERSION = '1.0.4'
end
8 changes: 4 additions & 4 deletions spec/support/views/page-one-record-with-selector.erb
@@ -1,10 +1,10 @@
<div>
<div class='the-selector' data-team-id='1'>
<div class='the-selector'>
<div data-team-id='1'>
<div data-attribute-for='name'>Ajax</div>
</div>
</div>
<div>
<div class='other-selector' data-team-id='1'>
<div class='other-selector'>
<div data-team-id='1'>
<div data-attribute-for='name'>Ajax</div>
</div>
</div>
Expand Up @@ -8,4 +8,7 @@
<tr data-team-id='1'>
<td data-attribute-for='name'>Ajax</td>
</tr>
<tr data-team-id='1'>
<td data-attribute-for='name'>Ajax</td>
</tr>
</table>
8 changes: 5 additions & 3 deletions spec/support/views/page-without-records-with-selector.erb
@@ -1,3 +1,5 @@
<div class='other-selector' data-team-id='1'>
<div data-attribute-for='name'>Ajax</div>
</div>
<div class='other-selector'>
<div data-team-id='1'>
<div data-attribute-for='name'>Ajax</div>
</div>
</div>

0 comments on commit a86e822

Please sign in to comment.