expressly 2.0.34.rc1 → 2.0.35.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,45 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ module Expressly
4
+
5
+ describe "MerchantPluginProvider" do
6
+
7
+ it "reports not implemented error when popup_handler is called" do
8
+ expect { MerchantPluginProvider.new.popup_handler(nil, nil) }.to raise_error
9
+ end
10
+
11
+ it "reports not implemented error when customer_register is called" do
12
+ expect { MerchantPluginProvider.new.customer_register(nil, nil) }.to raise_error
13
+ end
14
+
15
+ it "reports not implemented error when customer_send_password_reset_email is called" do
16
+ expect { MerchantPluginProvider.new.customer_send_password_reset_email(nil) }.to raise_error
17
+ end
18
+
19
+ it "reports not implemented error when customer_update_cart is called" do
20
+ expect { MerchantPluginProvider.new.customer_update_cart(nil, nil) }.to raise_error
21
+ end
22
+
23
+ it "reports not implemented error when customer_login is called" do
24
+ expect { MerchantPluginProvider.new.customer_login(nil) }.to raise_error
25
+ end
26
+
27
+ it "reports not implemented error when customer_migrated_redirect_url is called" do
28
+ expect { MerchantPluginProvider.new.customer_migrated_redirect_url(nil, nil) }.to raise_error
29
+ end
30
+
31
+ it "reports not implemented error when get_customer is called" do
32
+ expect { MerchantPluginProvider.new.get_customer(nil) }.to raise_error
33
+ end
34
+
35
+ it "reports not implemented error when check_customer_statuses is called" do
36
+ expect { MerchantPluginProvider.new.check_customer_statuses(nil) }.to raise_error
37
+ end
38
+
39
+ it "reports not implemented error when get_customer_invoices is called" do
40
+ expect { MerchantPluginProvider.new.get_customer_invoices(nil) }.to raise_error
41
+ end
42
+ end
43
+ end
44
+
45
+ require 'fakeweb'
@@ -2,10 +2,55 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
  require 'open-uri'
3
3
  require 'expressly'
4
4
 
5
- describe "Expressly" do
6
-
7
- it "can do something" do
8
- true
5
+ module Expressly
6
+
7
+ encoded_api_key = Base64.strict_encode64('api_key')
8
+
9
+ describe "Expressly" do
10
+ it "can have a default config set" do
11
+ config = Configuration.new(
12
+ encoded_api_key,
13
+ 'merchant_plugin_provider',
14
+ 'merchant_plugin_endpoint')
15
+
16
+
17
+ Expressly.default_configuration.nil?.should == true
18
+ Expressly.default_configuration?.should == false
19
+
20
+ Expressly.default_configuration = config
21
+
22
+ Expressly.default_configuration.should == config
23
+ Expressly.default_configuration?.should == true
24
+ end
25
+ end
26
+
27
+ describe "Configuration" do
28
+ it "is initialised correctly" do
29
+ config = Configuration.new(
30
+ 'api_key:api_key',
31
+ 'merchant_plugin_provider',
32
+ 'merchant_plugin_endpoint',
33
+ 'merchant_metadata',
34
+ 'expressly_endpoint')
35
+
36
+ config.api_key.should == 'api_key:api_key'
37
+ config.merchant_plugin_provider.should == 'merchant_plugin_provider'
38
+ config.merchant_plugin_endpoint.should == 'merchant_plugin_endpoint'
39
+ config.merchant_metadata.should == 'merchant_metadata'
40
+ config.expressly_endpoint.should == 'expressly_endpoint'
41
+ end
42
+
43
+ it "is initialised correctly with defaults" do
44
+ config = Configuration.new(
45
+ encoded_api_key,
46
+ 'merchant_plugin_provider',
47
+ 'merchant_plugin_endpoint')
48
+
49
+ config.api_key.should == 'api_key'
50
+ config.merchant_plugin_provider.should == 'merchant_plugin_provider'
51
+ config.merchant_plugin_endpoint.should == 'merchant_plugin_endpoint'
52
+ config.merchant_metadata.should == {}
53
+ config.expressly_endpoint.should == 'https://prod.expresslyapp.com/api'
54
+ end
9
55
  end
10
-
11
56
  end
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,13 @@
1
+ require 'codeclimate-test-reporter'
2
+ CodeClimate::TestReporter.start
3
+
4
+ require 'fakeweb'
5
+
1
6
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
7
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
8
  require 'rspec'
4
9
  require 'expressly'
5
10
  require 'awesome_print'
6
-
7
11
  # Requires supporting files with custom matchers and macros, etc,
8
12
  # in ./support/ and its subdirectories.
9
13
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expressly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.34.rc1
4
+ version: 2.0.35.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc G. Smith
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.12'
69
+ - !ruby/object:Gem::Dependency
70
+ name: fakeweb
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.3'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.3'
69
83
  description: Expressly sdk to help with implementing the expressly e-commerce plug-in
70
84
  / module API
71
85
  email: marc@buyexpressly.com
@@ -75,9 +89,11 @@ extra_rdoc_files:
75
89
  - LICENSE.txt
76
90
  - README.rdoc
77
91
  files:
92
+ - ".codeclimate.yml"
78
93
  - ".document"
79
94
  - ".gitignore"
80
95
  - ".rspec"
96
+ - ".rubocop.yml"
81
97
  - ".travis.yml"
82
98
  - Gemfile
83
99
  - Gemfile.lock
@@ -95,7 +111,9 @@ files:
95
111
  - lib/expressly/plugin_provider.rb
96
112
  - lib/expressly/util.rb
97
113
  - lib/expressly/version.rb
114
+ - spec/expressly/api_spec.rb
98
115
  - spec/expressly/domain_spec.rb
116
+ - spec/expressly/plugin_provider_spec.rb
99
117
  - spec/expressly_spec.rb
100
118
  - spec/spec_helper.rb
101
119
  homepage: http://developer.buyexpressly.com