pagemodels 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,6 @@ module PageModels
16
16
  else
17
17
  goto(full_url)
18
18
  end
19
- verify!
20
19
  end
21
20
 
22
21
  def _verify!
@@ -2,10 +2,17 @@ PageModels::Base.send(:include, RSpec::Matchers)
2
2
 
3
3
  module PageModels
4
4
  module RSpecIntegration
5
+ def try_to_open_page(page_model)
6
+ page_model = page_model.new if page_model.is_a? Class
7
+ $page_model = page_model
8
+ $page_model.open!
9
+ end
10
+
5
11
  def open_page(page_model)
6
12
  page_model = page_model.new if page_model.is_a? Class
7
13
  $page_model = page_model
8
14
  $page_model.open!
15
+ $page_model._verify!
9
16
  end
10
17
 
11
18
  def should_see_page(page_model)
@@ -13,7 +20,6 @@ module PageModels
13
20
  $page_model = page_model
14
21
  $page_model._verify!
15
22
  end
16
-
17
23
  end
18
24
 
19
25
  module PageModelMethodDelegation
@@ -1,3 +1,3 @@
1
1
  module PageModels
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -53,49 +53,43 @@ describe PageModels::Base do
53
53
  it "uses the base URL from config" do
54
54
  pm = TestPageModel.new("/foo")
55
55
  pm.should_receive(:visit).with("https://1.2.3.4:4321/foo")
56
- pm.should_receive(:verify!)
57
56
  pm.open!
58
57
  end
59
58
 
60
59
  it "ignores base URL if http:// is specified" do
61
60
  pm = TestPageModel.new("http://foo")
62
61
  pm.should_receive(:visit).with("http://foo")
63
- pm.should_receive(:verify!)
64
62
  pm.open!
65
63
  end
66
64
 
67
65
  it "ignores base URL if https:// is specified" do
68
66
  pm = TestPageModel.new("https://foo")
69
67
  pm.should_receive(:visit).with("https://foo")
70
- pm.should_receive(:verify!)
71
68
  pm.open!
72
69
  end
73
70
  end
74
71
 
75
72
  describe "opening a page with driver" do
76
73
  describe "for capybara" do
77
- it "should visit the page, then call verify" do
74
+ it "should visit the page" do
78
75
  PageModels::Configuration.instance.stub(:driver).and_return(Capybara::Session.new)
79
76
  @page_model.should_receive(:visit).with("http://test-page")
80
- @page_model.should_receive(:verify!)
81
77
  @page_model.open!
82
78
  end
83
79
  end
84
80
 
85
81
  describe "for celerity" do
86
- it "should goto the page, then call verify" do
82
+ it "should goto the page" do
87
83
  PageModels::Configuration.instance.stub(:driver).and_return(Celerity::Browser.new)
88
84
  @page_model.should_receive(:goto).with("http://test-page")
89
- @page_model.should_receive(:verify!)
90
85
  @page_model.open!
91
86
  end
92
87
  end
93
88
 
94
89
  describe "for watir-webdriver" do
95
- it "should goto the page, then call verify" do
90
+ it "should goto the page" do
96
91
  PageModels::Configuration.instance.stub(:driver).and_return(Watir::Browser.new(:chrome))
97
92
  @page_model.should_receive(:goto).with("http://test-page")
98
- @page_model.should_receive(:verify!)
99
93
  @page_model.open!
100
94
  end
101
95
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagemodels
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
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: 2013-01-23 00:00:00.000000000 Z
12
+ date: 2013-01-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake