spree_terms_and_conditions 2.1.4 → 2.1.5
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 +4 -4
- data/Gemfile +4 -0
- data/README.md +17 -11
- data/Rakefile +5 -0
- data/features/spree/terms_and_conditions.feature +15 -0
- data/features/step_definitions/terms_and_conditions.rb +64 -0
- data/features/support/env.rb +27 -0
- data/lib/spree_terms_and_conditions.rb +1 -0
- data/spree_terms_and_conditions.gemspec +4 -1
- metadata +50 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e6a60ec7f0264210fc9a7afcb2427eabda6151c
|
4
|
+
data.tar.gz: ec39009bfd0666394e079095bda8948debd9376c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70ef6bde9dc17ebc6717b5240238570b81663c930fc5a3c1434a2824534964c76df704a15162d97af04e569bd482fdcecc1f02609f09ed9e0fdd4e9663dc90c1
|
7
|
+
data.tar.gz: b0bff45a9dd594625b3130b76ae2e1238b247e484808c7b343c150e6988a249f241c910510b65e77f4dfdbd915e540e6f319945ca430088297beb6a6799e7d33
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -12,27 +12,33 @@ Installation
|
|
12
12
|
|
13
13
|
Add spree_terms_and_conditions to your Gemfile:
|
14
14
|
|
15
|
-
|
15
|
+
```ruby
|
16
|
+
gem 'spree_terms_and_conditions'
|
17
|
+
```
|
16
18
|
|
17
19
|
Bundle your dependencies and run the installation generator:
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
```sh
|
22
|
+
bundle
|
23
|
+
bundle exec rails g spree_terms_and_conditions:install
|
24
|
+
```
|
25
|
+
|
23
26
|
Add your terms and conditions page *in your Spree applications public folder*
|
24
27
|
|
25
|
-
|
28
|
+
```sh
|
29
|
+
echo 'Terms and Conditions' > public/terms_and_conditions.html
|
30
|
+
```
|
26
31
|
|
27
32
|
Testing
|
28
33
|
-------
|
29
34
|
|
30
35
|
Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.
|
31
36
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
+
```sh
|
38
|
+
bundle
|
39
|
+
bundle exec rake test_app
|
40
|
+
bundle exec rspec spec
|
41
|
+
bundle exec rake features
|
42
|
+
```
|
37
43
|
|
38
44
|
Copyright (c) 2013 [name of extension creator], released under the New BSD License
|
data/Rakefile
CHANGED
@@ -3,6 +3,7 @@ Bundler::GemHelper.install_tasks
|
|
3
3
|
|
4
4
|
require 'rspec/core/rake_task'
|
5
5
|
require 'spree/testing_support/extension_rake'
|
6
|
+
require 'cucumber/rake/task'
|
6
7
|
|
7
8
|
RSpec::Core::RakeTask.new
|
8
9
|
|
@@ -13,3 +14,7 @@ task :test_app do
|
|
13
14
|
ENV['LIB_NAME'] = 'spree_terms_and_conditions'
|
14
15
|
Rake::Task['extension:test_app'].invoke
|
15
16
|
end
|
17
|
+
|
18
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
19
|
+
t.cucumber_opts = "features --format pretty"
|
20
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Feature: Checkout page should include terms and conditions
|
2
|
+
|
3
|
+
In order to purchase a product
|
4
|
+
As a customer
|
5
|
+
I have to agree to the terms and conditions
|
6
|
+
|
7
|
+
Scenario: Display terms and conditions at checkout page
|
8
|
+
Given I have a product in my cart
|
9
|
+
And I am at the checkout page
|
10
|
+
Then I should see "Terms And Conditions"
|
11
|
+
And I should see "I accept the terms and conditions for the website"
|
12
|
+
When I want to finish the checkout without accepting the terms
|
13
|
+
Then I should see "Terms and conditions must be accepted"
|
14
|
+
When I want to finish the checkout and accepting the terms
|
15
|
+
Then I should be at the payment page
|
@@ -0,0 +1,64 @@
|
|
1
|
+
Given(/^I have a product in my cart$/) do
|
2
|
+
create(:address)
|
3
|
+
create(:free_shipping_method)
|
4
|
+
create(:product, :name => "Github Mug")
|
5
|
+
visit "/"
|
6
|
+
click_link "Github Mug"
|
7
|
+
click_button "add-to-cart-button"
|
8
|
+
end
|
9
|
+
|
10
|
+
Given(/^I am at the checkout page$/) do
|
11
|
+
click_button "checkout-link"
|
12
|
+
|
13
|
+
address = Spree::Address.last
|
14
|
+
fill_in("order_email", :with => "sample@web.com")
|
15
|
+
within("#billing") do
|
16
|
+
fill_in("order_bill_address_attributes_firstname",
|
17
|
+
:with => address.firstname)
|
18
|
+
fill_in("order_bill_address_attributes_lastname",
|
19
|
+
:with => address.lastname)
|
20
|
+
fill_in("order_bill_address_attributes_address1",
|
21
|
+
:with => address.address1)
|
22
|
+
fill_in("order_bill_address_attributes_address2",
|
23
|
+
:with => address.address2)
|
24
|
+
fill_in("order_bill_address_attributes_city",
|
25
|
+
:with => address.city)
|
26
|
+
fill_in("order_bill_address_attributes_zipcode",
|
27
|
+
:with => address.zipcode)
|
28
|
+
fill_in("order_bill_address_attributes_phone",
|
29
|
+
:with => address.phone)
|
30
|
+
end
|
31
|
+
click_button("Save and Continue")
|
32
|
+
end
|
33
|
+
|
34
|
+
Then(/^I should see "(.*?)"$/) do |text|
|
35
|
+
expect(page).to have_content(text)
|
36
|
+
end
|
37
|
+
|
38
|
+
Then(/^show me the page$/) do
|
39
|
+
save_and_open_page
|
40
|
+
end
|
41
|
+
|
42
|
+
When(/^I want to finish the checkout without accepting the terms$/) do
|
43
|
+
steps %Q{
|
44
|
+
When I finish the checkout
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
When(/^I want to finish the checkout and accepting the terms$/) do
|
49
|
+
check("order_terms_and_conditions")
|
50
|
+
steps %Q{
|
51
|
+
When I finish the checkout
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
When(/^I finish the checkout$/) do
|
56
|
+
click_button("Save and Continue")
|
57
|
+
end
|
58
|
+
|
59
|
+
Then(/^I should be at the payment page$/) do
|
60
|
+
steps %Q{
|
61
|
+
Then I should see "Checkout"
|
62
|
+
Then I should see "Payment Information"
|
63
|
+
}
|
64
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
ENV["RAILS_ROOT"] = File.expand_path("../../../spec/dummy", __FILE__)
|
3
|
+
|
4
|
+
require "cucumber/rails"
|
5
|
+
require "selenium/webdriver"
|
6
|
+
require 'spree/testing_support/factories'
|
7
|
+
require 'spree_terms_and_conditions/factories'
|
8
|
+
require 'factory_girl'
|
9
|
+
require 'ffaker'
|
10
|
+
require 'database_cleaner'
|
11
|
+
|
12
|
+
Cucumber::Rails::World.use_transactional_fixtures = false
|
13
|
+
DatabaseCleaner.strategy = :truncation
|
14
|
+
|
15
|
+
Dir["#{File.expand_path("../../../", __FILE__)}/spec/support/**/*.rb"].each do |f|
|
16
|
+
require f
|
17
|
+
end
|
18
|
+
|
19
|
+
World FactoryGirl::Syntax::Methods
|
20
|
+
|
21
|
+
Before do
|
22
|
+
DatabaseCleaner.start
|
23
|
+
end
|
24
|
+
|
25
|
+
After do |scenario|
|
26
|
+
DatabaseCleaner.clean
|
27
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.platform = Gem::Platform::RUBY
|
4
4
|
s.name = 'spree_terms_and_conditions'
|
5
|
-
s.version = '2.1.
|
5
|
+
s.version = '2.1.5'
|
6
6
|
s.summary = 'Add terms and conditions checkbox in delivery stage of checkout'
|
7
7
|
s.description = ''
|
8
8
|
s.required_ruby_version = '>= 2.0.0'
|
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_dependency 'spree_core', '~> 2.1.3'
|
20
20
|
s.add_dependency 'spree_frontend', '~> 2.1.3'
|
21
21
|
s.add_dependency 'spree_backend', '~> 2.1.3'
|
22
|
+
s.add_dependency 'haml-rails'
|
22
23
|
|
23
24
|
s.add_development_dependency 'capybara', '~> 2.1'
|
24
25
|
s.add_development_dependency 'coffee-rails'
|
@@ -30,4 +31,6 @@ Gem::Specification.new do |s|
|
|
30
31
|
s.add_development_dependency 'selenium-webdriver'
|
31
32
|
s.add_development_dependency 'simplecov'
|
32
33
|
s.add_development_dependency 'sqlite3'
|
34
|
+
s.add_development_dependency 'cucumber-rails'
|
35
|
+
s.add_development_dependency 'launchy'
|
33
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_terms_and_conditions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francisco Trindade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.1.3
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: haml-rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: capybara
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,6 +206,34 @@ dependencies:
|
|
192
206
|
- - '>='
|
193
207
|
- !ruby/object:Gem::Version
|
194
208
|
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: cucumber-rails
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - '>='
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - '>='
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: launchy
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - '>='
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - '>='
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
195
237
|
description: ''
|
196
238
|
email: frank.trindade@gmail.com
|
197
239
|
executables: []
|
@@ -216,6 +258,9 @@ files:
|
|
216
258
|
- config/locales/en.yml
|
217
259
|
- config/routes.rb
|
218
260
|
- db/migrate/20131220080614_add_terms_and_conditions_to_orders.rb
|
261
|
+
- features/spree/terms_and_conditions.feature
|
262
|
+
- features/step_definitions/terms_and_conditions.rb
|
263
|
+
- features/support/env.rb
|
219
264
|
- lib/generators/spree_terms_and_conditions/install/install_generator.rb
|
220
265
|
- lib/spree_terms_and_conditions.rb
|
221
266
|
- lib/spree_terms_and_conditions/engine.rb
|
@@ -248,5 +293,8 @@ signing_key:
|
|
248
293
|
specification_version: 4
|
249
294
|
summary: Add terms and conditions checkbox in delivery stage of checkout
|
250
295
|
test_files:
|
296
|
+
- features/spree/terms_and_conditions.feature
|
297
|
+
- features/step_definitions/terms_and_conditions.rb
|
298
|
+
- features/support/env.rb
|
251
299
|
- spec/models/order_spec.rb
|
252
300
|
- spec/spec_helper.rb
|