site_prism.vcr 0.0.1 → 0.1.0
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.
- checksums.yaml +5 -13
- data/.travis.yml +1 -0
- data/CHANGELOG.md +78 -0
- data/Gemfile +2 -0
- data/README.md +61 -24
- data/TODO.md +28 -40
- data/lib/site_prism_vcr/applier.rb +20 -6
- data/lib/site_prism_vcr/dsl/adjuster.rb +40 -19
- data/lib/site_prism_vcr/dsl/initial_adjuster.rb +1 -1
- data/lib/site_prism_vcr/element.rb +8 -5
- data/lib/site_prism_vcr/fixture.rb +0 -1
- data/lib/site_prism_vcr/options.rb +12 -1
- data/lib/site_prism_vcr/patches/element_container.rb +4 -0
- data/lib/site_prism_vcr/patches/page.rb +25 -27
- data/lib/site_prism_vcr/version.rb +1 -1
- data/site_prism.vcr.gemspec +2 -2
- data/spec/integration/elements/apply_spec.rb +100 -0
- data/spec/integration/elements/events/click_spec.rb +20 -0
- data/spec/integration/{immediate_http_interactions/page_load_on_click_spec.rb → pages/custom_event_spec.rb} +5 -3
- data/spec/integration/{immediate_http_interactions/page_load_spec.rb → pages/load_spec.rb} +13 -9
- data/spec/spec_helper.rb +3 -0
- data/spec/support/shared/integration/custom_fixtures.rb +17 -0
- data/spec/support/shared/integration/exchange.rb +1 -1
- data/spec/support/shared/integration/home_path.rb +1 -1
- data/spec/support/shared/integration/waiter.rb +37 -25
- data/spec/support/site_prism/pages/home.rb +7 -0
- data/spec/support/site_prism/pages/{immediate_http_interactions → page_load}/home_path.rb +1 -1
- data/spec/support/site_prism/pages/{immediate_http_interactions → page_load}/one_request.rb +1 -1
- data/spec/support/site_prism/pages/{immediate_http_interactions → page_load}/subpage.rb +1 -1
- data/spec/support/site_prism/pages/{immediate_http_interactions → page_load}/two_requests.rb +1 -1
- data/spec/support/site_prism/pages/{immediate_http_interactions → page_load}/waiter_without_fixtures_ejection.rb +1 -1
- data/spec/unit/applier_spec.rb +74 -56
- data/spec/unit/dsl/adjuster_spec.rb +58 -47
- data/spec/unit/dsl/initial_adjuster_spec.rb +18 -12
- data/spec/unit/element_spec.rb +11 -13
- data/spec/unit/fixtures/handler_spec.rb +7 -2
- data/spec/unit/fixtures/manager_spec.rb +20 -4
- data/spec/unit/fixtures/modifiers/home_path_spec.rb +14 -3
- data/spec/unit/fixtures/modifiers/path_spec.rb +9 -3
- data/spec/unit/fixtures/tmp_keeper_spec.rb +1 -1
- data/spec/unit/fixtures_spec.rb +5 -5
- data/spec/unit/options_spec.rb +35 -1
- data/spec/unit/patches/element_container_spec.rb +25 -12
- data/spec/unit/patches/page_spec.rb +23 -30
- data/spec/unit/waiter_spec.rb +16 -4
- metadata +30 -30
- data/spec/integration/http_interactions_on_even/click_spec.rb +0 -75
- data/spec/unit/element_container_spec.rb +0 -48
data/site_prism.vcr.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency 'site_prism', '~> 2.
|
22
|
-
spec.add_dependency 'vcr', '~> 2.
|
21
|
+
spec.add_dependency 'site_prism', '~> 2.5'
|
22
|
+
spec.add_dependency 'vcr', '~> 2.8.0'
|
23
23
|
spec.add_dependency 'webmock'
|
24
24
|
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
require 'spec_integration_helper'
|
2
|
+
|
3
|
+
feature 'Elements > Apply Vcr' do
|
4
|
+
# It may be any other event, we use click event
|
5
|
+
# because it is the simplest one
|
6
|
+
def shift_click_event(link)
|
7
|
+
link.shift_event { link.click }
|
8
|
+
end
|
9
|
+
|
10
|
+
def shift_click_event_to(link_name)
|
11
|
+
link = test_app_page.public_send(link_name)
|
12
|
+
shift_click_event(link)
|
13
|
+
end
|
14
|
+
|
15
|
+
let(:cat_owner) { test_app_page.cat_owner }
|
16
|
+
let(:test_app_page) { HomePage.new }
|
17
|
+
let(:action_method) { :apply_vcr }
|
18
|
+
|
19
|
+
before do
|
20
|
+
test_app_page.load
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'clicks and handles one HTTP request' do
|
24
|
+
before do
|
25
|
+
shift_click_event_to(:link_with_one_request).apply_vcr
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'applies a default fixture' do
|
29
|
+
expect(test_app_page.cat_owner).to have_content('Ned Stark')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context 'when VCR is associated with already defined elements' do
|
34
|
+
before do
|
35
|
+
shift_click_event_to(:link_without_vcr).apply_vcr
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'applies a default fixture' do
|
39
|
+
expect(test_app_page.cat_owner).to have_content('Ned Stark')
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'when there is a delay between clicking and doing an HTTP request' do
|
44
|
+
before do
|
45
|
+
shift_click_event_to(:link_with_one_request_and_delay).apply_vcr
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'applies a fixture and waits for results' do
|
49
|
+
expect(cat_owner).to have_content('Ned Stark')
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# TODO: should we write the same test for the page load?
|
54
|
+
context 'when an user clicks on the link which causes 2 HTTP requests' do
|
55
|
+
before do
|
56
|
+
shift_click_event_to(:link_with_2_requests).apply_vcr
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'applies 2 fixtures' do
|
60
|
+
expect(cat_owner).to have_content('Ned Stark')
|
61
|
+
expect(cat_owner).to have_content('Robb Stark')
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
it_behaves_like 'when a custom fixture is applied' do
|
66
|
+
let(:actor) { shift_click_event_to(:link_with_one_request) }
|
67
|
+
|
68
|
+
context 'when clicks again without specifying a custom fixture' do
|
69
|
+
it 'uses a default fixture again' do
|
70
|
+
actor.apply_vcr
|
71
|
+
|
72
|
+
expect(cat_owner).to have_content('Ned Stark')
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
context 'waiters' do
|
78
|
+
it_behaves_like 'when a default waiter does not eject fixtures' do
|
79
|
+
let(:actor) { shift_click_event_to(:link_without_ejecting_fixtures) }
|
80
|
+
end
|
81
|
+
|
82
|
+
it_behaves_like 'when options are redefined for waiters' do
|
83
|
+
let(:actor) { shift_click_event_to(:link_with_2_requests) }
|
84
|
+
end
|
85
|
+
|
86
|
+
it_behaves_like 'custom waiters' do
|
87
|
+
let(:actor) { shift_click_event_to(:link_with_2_requests) }
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
it_behaves_like 'when a home path is define' do
|
92
|
+
let(:actor_with_home_path) { shift_click_event_to(:link_with_home_path) }
|
93
|
+
let(:actor_without_home_path) { shift_click_event_to(:link_with_one_request) }
|
94
|
+
end
|
95
|
+
|
96
|
+
it_behaves_like 'when a default fixture is exchanged' do
|
97
|
+
let(:actor_with_home_path) { shift_click_event_to(:link_with_home_path) }
|
98
|
+
let(:actor_without_home_path) { shift_click_event_to(:link_with_2_requests) }
|
99
|
+
end
|
100
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_integration_helper'
|
2
|
+
|
3
|
+
feature 'Elements > Events > Click' do
|
4
|
+
let(:cat_owner) { test_app_page.cat_owner }
|
5
|
+
let(:test_app_page) { HomePage.new }
|
6
|
+
|
7
|
+
before do
|
8
|
+
test_app_page.load
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'applies and handles HTTP request' do
|
12
|
+
before do
|
13
|
+
test_app_page.link_with_one_request.click_and_apply_vcr
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'applies a default fixture' do
|
17
|
+
expect(test_app_page.cat_owner).to have_content('Ned Stark')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -1,13 +1,15 @@
|
|
1
1
|
require 'spec_integration_helper'
|
2
2
|
|
3
|
-
feature '
|
4
|
-
let(:one_request_page) {
|
3
|
+
feature 'Pages > Load > Custom event' do
|
4
|
+
let(:one_request_page) { PageLoad::OneRequestPage.new }
|
5
5
|
|
6
6
|
before do
|
7
7
|
index_page = HomePage.new
|
8
8
|
index_page.load
|
9
9
|
|
10
|
-
one_request_page.
|
10
|
+
one_request_page.shift_event {
|
11
|
+
index_page.link_to_go_to_another_page.click
|
12
|
+
}.apply_vcr
|
11
13
|
end
|
12
14
|
|
13
15
|
it 'loads fixtures on opening a page by click on a link' do
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_integration_helper'
|
2
2
|
|
3
|
-
feature '
|
3
|
+
feature 'Pages > Load' do
|
4
4
|
let(:cat_owner) { test_app_page.cat_owner }
|
5
|
-
let(:test_app_page) {
|
5
|
+
let(:test_app_page) { PageLoad::OneRequestPage.new }
|
6
6
|
let(:action_method) { :load_and_apply_vcr }
|
7
7
|
|
8
8
|
context 'when one default fixture is defined' do
|
@@ -20,7 +20,7 @@ feature 'Immediate Http interactions > Page load' do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
context 'when a subpage inherits a page with a defined vcr options' do
|
23
|
-
let(:test_app_page) {
|
23
|
+
let(:test_app_page) { PageLoad::SubPage.new }
|
24
24
|
|
25
25
|
it 'subpage inherits the defined options for its parent page' do
|
26
26
|
test_app_page.load_and_apply_vcr
|
@@ -35,22 +35,26 @@ feature 'Immediate Http interactions > Page load' do
|
|
35
35
|
|
36
36
|
context 'waiters' do
|
37
37
|
it_behaves_like 'when a default waiter does not eject fixtures' do
|
38
|
-
let(:actor) {
|
38
|
+
let(:actor) { PageLoad::WaiterWithoutFixturesEjectionPage.new }
|
39
|
+
end
|
40
|
+
|
41
|
+
it_behaves_like 'when options are redefined for waiters' do
|
42
|
+
let(:actor) { PageLoad::TwoRequestsPage.new }
|
39
43
|
end
|
40
44
|
|
41
45
|
it_behaves_like 'custom waiters' do
|
42
|
-
let(:actor) {
|
46
|
+
let(:actor) { PageLoad::TwoRequestsPage.new }
|
43
47
|
let(:test_app_page) { actor }
|
44
48
|
end
|
45
49
|
end
|
46
50
|
|
47
51
|
it_behaves_like 'when a home path is define' do
|
48
|
-
let(:actor_with_home_path) {
|
49
|
-
let(:actor_without_home_path) {
|
52
|
+
let(:actor_with_home_path) { PageLoad::HomePathPage.new }
|
53
|
+
let(:actor_without_home_path) { PageLoad::OneRequestPage.new }
|
50
54
|
end
|
51
55
|
|
52
56
|
it_behaves_like 'when a default fixture is exchanged' do
|
53
|
-
let(:actor_without_home_path) {
|
54
|
-
let(:actor_with_home_path) {
|
57
|
+
let(:actor_without_home_path) { PageLoad::TwoRequestsPage.new }
|
58
|
+
let(:actor_with_home_path) { PageLoad::HomePathPage.new }
|
55
59
|
end
|
56
60
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'bundler/setup'
|
2
2
|
|
3
3
|
require 'rspec'
|
4
|
+
require 'rspec/fire'
|
4
5
|
require 'coveralls'
|
5
6
|
|
6
7
|
require 'site_prism.vcr'
|
@@ -11,6 +12,8 @@ RSpec.configure do |config|
|
|
11
12
|
config.expect_with :rspec do |c|
|
12
13
|
c.syntax = :expect
|
13
14
|
end
|
15
|
+
|
16
|
+
config.include(RSpec::Fire)
|
14
17
|
end
|
15
18
|
|
16
19
|
VCR.configure do |c|
|
@@ -29,4 +29,21 @@ shared_examples 'when a custom fixture is applied' do
|
|
29
29
|
expect(cat_owner).to have_content('Robert Baratheon')
|
30
30
|
end
|
31
31
|
end
|
32
|
+
|
33
|
+
context 'when "replace" action is defined before defining fixtures to be used for replacing' do
|
34
|
+
before do
|
35
|
+
actor.public_send(action_method) do
|
36
|
+
replace
|
37
|
+
path 'custom', ['daenerys_targaryen']
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
after do
|
42
|
+
SPV::Helpers.eject_all_cassettes
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'uses custom fixture anyway' do
|
46
|
+
expect(cat_owner).to have_content('Daenerys Targaryen')
|
47
|
+
end
|
48
|
+
end
|
32
49
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
shared_examples 'when a home path is define' do
|
2
2
|
shared_examples 'expects the custom fixture on the page' do
|
3
3
|
it 'applies a stored fixture in the directory defined in the home path' do
|
4
|
-
expect(
|
4
|
+
expect(cat_owner).to have_content('Bran Stark')
|
5
5
|
end
|
6
6
|
end
|
7
7
|
|
@@ -1,3 +1,23 @@
|
|
1
|
+
shared_examples 'when cassettes are not ejected' do |texts, cassettes|
|
2
|
+
after do
|
3
|
+
SPV::Helpers.eject_all_cassettes
|
4
|
+
end
|
5
|
+
|
6
|
+
it 'uses a default waiter' do
|
7
|
+
texts.each do |expected_text|
|
8
|
+
expect(cat_owner).to have_content(expected_text)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'VCR contains all cassettes' do
|
13
|
+
cassettes.each do |expected_cassette|
|
14
|
+
expect(VCR.eject_cassette.name).to eq(expected_cassette)
|
15
|
+
end
|
16
|
+
|
17
|
+
expect(VCR.eject_cassette).to be_nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
1
21
|
shared_examples 'custom waiters' do
|
2
22
|
context 'when a waiter is redefined' do
|
3
23
|
before do
|
@@ -36,20 +56,9 @@ shared_examples 'custom waiters' do
|
|
36
56
|
end
|
37
57
|
end
|
38
58
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
it 'uses a custom waiter' do
|
44
|
-
expect(cat_owner).to have_content('Arya Stark')
|
45
|
-
expect(cat_owner).to have_content('Jon Snow')
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'VCR contains all cassettes' do
|
49
|
-
expect(VCR.eject_cassette.name).to eq('jon_snow')
|
50
|
-
expect(VCR.eject_cassette.name).to eq('arya_stark')
|
51
|
-
expect(VCR.eject_cassette).to be_nil
|
52
|
-
end
|
59
|
+
it_behaves_like 'when cassettes are not ejected',
|
60
|
+
['Arya Stark', 'Jon Snow'],
|
61
|
+
['jon_snow', 'arya_stark']
|
53
62
|
end
|
54
63
|
end
|
55
64
|
|
@@ -58,18 +67,21 @@ shared_examples 'when a default waiter does not eject fixtures' do
|
|
58
67
|
actor.public_send(action_method)
|
59
68
|
end
|
60
69
|
|
61
|
-
|
62
|
-
|
63
|
-
|
70
|
+
it_behaves_like 'when cassettes are not ejected',
|
71
|
+
['Ned Stark', 'Robb Stark'],
|
72
|
+
['robb_stark', 'ned_stark']
|
73
|
+
end
|
64
74
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
75
|
+
shared_examples 'when options are redefined for waiters' do
|
76
|
+
context 'when the option to not eject default fixtures is passed' do
|
77
|
+
before do
|
78
|
+
actor.public_send(action_method) do
|
79
|
+
waiter_options(eject_cassettes: false)
|
80
|
+
end
|
81
|
+
end
|
69
82
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
expect(VCR.eject_cassette).to be_nil
|
83
|
+
it_behaves_like 'when cassettes are not ejected',
|
84
|
+
['Ned Stark', 'Robb Stark'],
|
85
|
+
['robb_stark', 'ned_stark']
|
74
86
|
end
|
75
87
|
end
|
@@ -41,4 +41,11 @@ class HomePage < BasePage
|
|
41
41
|
fixtures ['ned_stark', 'robb_stark']
|
42
42
|
waiter({eject_cassettes: false}, &:wait_for_ned_stark_and_robb_stark)
|
43
43
|
end
|
44
|
+
|
45
|
+
element :link_without_vcr, '#link_with_one_request'
|
46
|
+
|
47
|
+
link_vcr_with_element :link_without_vcr do
|
48
|
+
fixtures ['ned_stark']
|
49
|
+
waiter &:wait_for_cat_owner
|
50
|
+
end
|
44
51
|
end
|
data/spec/unit/applier_spec.rb
CHANGED
@@ -1,11 +1,16 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe SPV::Applier do
|
4
|
-
let(:node) { double }
|
5
|
-
let(:options) {
|
6
|
-
let(:fixtures_manager) {
|
7
|
-
let(:fixtures) { double }
|
8
|
-
let(:initial_adjuster)
|
4
|
+
let(:node) { double('node of DOM') }
|
5
|
+
let(:options) { instance_double('SPV::Options') }
|
6
|
+
let(:fixtures_manager) { instance_double('SPV::Fixtures::Manager', inject: true) }
|
7
|
+
let(:fixtures) { double('fixtures') }
|
8
|
+
let(:initial_adjuster) do
|
9
|
+
instance_double(
|
10
|
+
'SPV::DSL::InitialAdjuster',
|
11
|
+
prepare_fixtures: fixtures
|
12
|
+
)
|
13
|
+
end
|
9
14
|
|
10
15
|
before do
|
11
16
|
SPV::Options.stub(:new).and_return(options)
|
@@ -50,7 +55,7 @@ describe SPV::Applier do
|
|
50
55
|
end
|
51
56
|
|
52
57
|
it 'receives the fixtures container' do
|
53
|
-
expect(initial_adjuster).to receive(:
|
58
|
+
expect(initial_adjuster).to receive(:prepare_fixtures)
|
54
59
|
|
55
60
|
subject
|
56
61
|
end
|
@@ -64,71 +69,84 @@ describe SPV::Applier do
|
|
64
69
|
end
|
65
70
|
end
|
66
71
|
|
67
|
-
describe '#
|
68
|
-
let(:
|
69
|
-
let(:options) { double(clone_options: cloned_options) }
|
70
|
-
let(:waiter) { double(wait: true) }
|
71
|
-
let(:prepared_fixtures) { 'prepared_fixtures by adjuster' }
|
72
|
-
|
73
|
-
let(:adjuster) do
|
74
|
-
double(
|
75
|
-
mymeth: true,
|
76
|
-
fixtures: true,
|
77
|
-
replace: true,
|
78
|
-
prepared_fixtures: prepared_fixtures
|
79
|
-
)
|
80
|
-
end
|
81
|
-
|
72
|
+
describe '#apply_vcr' do
|
73
|
+
let(:node) { double('node of DOM', click: true) }
|
82
74
|
subject(:applier) { described_class.new(node) { } }
|
83
75
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
76
|
+
context 'when an event is shifted' do
|
77
|
+
let(:cloned_options) { 'cloned options' }
|
78
|
+
let(:options) { instance_double('SPV::Options', clone_options: cloned_options) }
|
79
|
+
let(:waiter) { instance_double('SPV::Waiter', wait: true) }
|
80
|
+
let(:prepared_fixtures) { 'prepared_fixtures by adjuster' }
|
81
|
+
|
82
|
+
let(:adjuster) do
|
83
|
+
instance_double(
|
84
|
+
'DSL::Adjuster',
|
85
|
+
fixtures: true,
|
86
|
+
prepare_fixtures: prepared_fixtures
|
87
|
+
)
|
88
|
+
end
|
88
89
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
fixtures
|
93
|
-
)
|
90
|
+
before do
|
91
|
+
SPV::DSL::Adjuster.stub(:new).and_return(adjuster)
|
92
|
+
SPV::Waiter.stub(:new).and_return(waiter)
|
94
93
|
|
95
|
-
|
96
|
-
|
94
|
+
applier.shift_event { node.click }
|
95
|
+
end
|
97
96
|
|
98
|
-
|
99
|
-
|
97
|
+
it 'initializes the fixtures adjuster with a new instance of options' do
|
98
|
+
expect(SPV::DSL::Adjuster).to receive(:new).with(
|
99
|
+
cloned_options,
|
100
|
+
fixtures
|
101
|
+
)
|
100
102
|
|
101
|
-
|
102
|
-
|
103
|
+
applier.apply_vcr
|
104
|
+
end
|
103
105
|
|
104
|
-
|
105
|
-
|
106
|
+
context 'when a block is given' do
|
107
|
+
it 'calls a given block within the context of the adjuster' do
|
108
|
+
expect(adjuster).to receive(:fixtures)
|
106
109
|
|
107
|
-
|
108
|
-
|
110
|
+
applier.apply_vcr { fixtures }
|
111
|
+
end
|
112
|
+
end
|
109
113
|
|
110
|
-
|
111
|
-
|
112
|
-
node,
|
113
|
-
fixtures_manager,
|
114
|
-
cloned_options
|
115
|
-
).and_return(waiter)
|
114
|
+
it 'applies fixtures' do
|
115
|
+
expect(fixtures_manager).to receive(:inject).with(prepared_fixtures)
|
116
116
|
|
117
|
-
|
118
|
-
|
117
|
+
applier.apply_vcr
|
118
|
+
end
|
119
119
|
|
120
|
-
|
121
|
-
|
120
|
+
it 'initializes the waiter' do
|
121
|
+
expect(SPV::Waiter).to receive(:new).with(
|
122
|
+
node,
|
123
|
+
fixtures_manager,
|
124
|
+
cloned_options
|
125
|
+
).and_return(waiter)
|
122
126
|
|
123
|
-
|
124
|
-
node.click
|
127
|
+
applier.apply_vcr
|
125
128
|
end
|
126
|
-
end
|
127
129
|
|
128
|
-
|
129
|
-
|
130
|
+
it 'does the click action over a node' do
|
131
|
+
expect(node).to receive(:click)
|
132
|
+
|
133
|
+
applier.apply_vcr
|
134
|
+
end
|
130
135
|
|
131
|
-
|
136
|
+
it 'waits until all HTTP interactions are finished' do
|
137
|
+
expect(waiter).to receive(:wait)
|
138
|
+
|
139
|
+
applier.apply_vcr
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
context 'when an event is not shifted' do
|
144
|
+
it 'raises an error about no event' do
|
145
|
+
expect{ subject.apply_vcr }.to raise_error(
|
146
|
+
SPV::Applier::EventError,
|
147
|
+
'Event is not shifted, before applying Vcr you have to shift event with "shift_event" method'
|
148
|
+
)
|
149
|
+
end
|
132
150
|
end
|
133
151
|
end
|
134
152
|
end
|