fracture 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +12 -2
- data/lib/fracture/fracture.rb +16 -4
- data/lib/fracture/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -65,8 +65,10 @@ require 'spec_helper'
|
|
65
65
|
describe ContactsController do
|
66
66
|
render_views
|
67
67
|
|
68
|
-
|
69
|
-
|
68
|
+
before(:all) do
|
69
|
+
Fracture.define_text(:add, "New")
|
70
|
+
end
|
71
|
+
|
70
72
|
context "as admin" do
|
71
73
|
describe "as an admin" do
|
72
74
|
it "index" do
|
@@ -154,6 +156,13 @@ response.body.should have_a_form.that_is_new.with_path_of("/tickets")
|
|
154
156
|
response.body.should have_a_form.with_path_of(tickets_path)
|
155
157
|
```
|
156
158
|
|
159
|
+
### Integration Specs Example
|
160
|
+
```ruby
|
161
|
+
page.body.should have_only_fractures(:label_2)
|
162
|
+
```
|
163
|
+
|
164
|
+
|
165
|
+
|
157
166
|
|
158
167
|
## All Methods:
|
159
168
|
|
@@ -169,6 +178,7 @@ response.body.should have_a_form.with_path_of(tickets_path)
|
|
169
178
|
# TODO
|
170
179
|
|
171
180
|
* Support text and selector in one fracture
|
181
|
+
* Support qty of expected fractures on page (selector count)
|
172
182
|
|
173
183
|
## Contributing
|
174
184
|
|
data/lib/fracture/fracture.rb
CHANGED
@@ -64,13 +64,25 @@ class Fracture
|
|
64
64
|
all.keys - list_to_s(Array(fractures).flatten)
|
65
65
|
end
|
66
66
|
|
67
|
+
#def do_check page, label
|
68
|
+
# #page = page.response.body if page.is_a? CompaniesController
|
69
|
+
# page = page.response.body if page.respond_to?(:response)
|
70
|
+
# page = Nokogiri::HTML.parse(page)
|
71
|
+
# if text?
|
72
|
+
# page.text.include?(label)
|
73
|
+
# else
|
74
|
+
# page.at label
|
75
|
+
# end
|
76
|
+
#end
|
67
77
|
def do_check page, label
|
68
|
-
|
69
|
-
|
78
|
+
page = page.response.body if page.respond_to?(:response)
|
79
|
+
|
80
|
+
page_parsed = Nokogiri::HTML.parse(page)
|
81
|
+
|
70
82
|
if text?
|
71
|
-
|
83
|
+
page_parsed.text.include?(label)
|
72
84
|
else
|
73
|
-
|
85
|
+
page_parsed.at label
|
74
86
|
end
|
75
87
|
end
|
76
88
|
|
data/lib/fracture/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fracture
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-03-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
102
|
rubyforge_project: fracture
|
103
|
-
rubygems_version: 1.8.
|
103
|
+
rubygems_version: 1.8.23
|
104
104
|
signing_key:
|
105
105
|
specification_version: 3
|
106
106
|
summary: Unified View testing within Views or Controllers for RSpec
|