i_contact 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,40 @@
1
+ require 'spec_helper'
2
+
3
+ describe IContact do
4
+ let(:app_id) { "app_id" }
5
+
6
+ before(:each) do
7
+ @config = IContact.configuration
8
+ end
9
+
10
+ after(:each) do
11
+ IContact.configuration = @config
12
+ end
13
+
14
+ it 'instantiates a configuration' do
15
+ IContact.configure do |config|
16
+ config.app_id = app_id
17
+ end
18
+
19
+ IContact.configuration.should be_kind_of(IContact::Configuration)
20
+ IContact.configuration.app_id.should eql(app_id)
21
+ end
22
+
23
+ it 'raises an exception if I do not have a valid configuration' do
24
+ IContact.configuration = mock
25
+ IContact.configuration.expects(:valid?).returns(false)
26
+ lambda { IContact.connection }.should raise_error(IContact::InvalidConfiguration)
27
+ end
28
+
29
+ it 'raises an exception if I do not specify a configuration' do
30
+ IContact.configuration = nil
31
+ lambda { IContact.connection }.should raise_error(IContact::InvalidConfiguration)
32
+
33
+ end
34
+
35
+ it 'includes the account id in the url by default' do
36
+ IContact.url.should =~ /#{IContact.configuration.account_id}/
37
+ end
38
+
39
+ end
40
+
@@ -0,0 +1,13 @@
1
+ require 'rspec'
2
+ require 'i_contact'
3
+ require 'mocha'
4
+
5
+ Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
6
+
7
+ RSpec.configure do |config|
8
+ config.mock_with :mocha
9
+ config.extend VCR::RSpec::Macros
10
+
11
+ config.treat_symbols_as_metadata_keys_with_true_values = true
12
+ end
13
+
@@ -0,0 +1,17 @@
1
+ require "active_attr/rspec"
2
+
3
+ module ActiveAttrMacros
4
+ def has_attr(attr, data_type = nil)
5
+
6
+ it do
7
+ if data_type
8
+ should have_attribute(attr).of_type(data_type)
9
+ else
10
+ should have_attribute(attr)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ RSpec.configure do |config|
16
+ config.extend(ActiveAttrMacros)
17
+ end
@@ -0,0 +1,9 @@
1
+ IContact.configure do |config|
2
+ config.mode = :sandbox
3
+ config.app_id = ENV["icontact_app_id"]
4
+ config.user_name = ENV["icontact_user_name"]
5
+ config.password = ENV["icontact_password"]
6
+ config.account_id = ENV["icontact_account_id"]
7
+ config.client_folder_id = ENV["icontact_client_folder_id"]
8
+ end
9
+
@@ -0,0 +1,17 @@
1
+ require 'vcr'
2
+ require 'vcr'
3
+
4
+ VCR.configure do |c|
5
+ c.cassette_library_dir = 'spec/cassettes'
6
+ c.hook_into :webmock
7
+ c.filter_sensitive_data('<APP_ID>') { IContact.configuration.app_id }
8
+ c.filter_sensitive_data('<USER_NAME>') { IContact.configuration.user_name }
9
+ c.filter_sensitive_data('<PASSWORD>') { IContact.configuration.password }
10
+ c.configure_rspec_metadata!
11
+
12
+ c.default_cassette_options = {
13
+ :record => :new_episodes,
14
+ :match_requests_on => [:uri, :body]
15
+ }
16
+ end
17
+
metadata ADDED
@@ -0,0 +1,301 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: i_contact
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Dan Pickett
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-06-09 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: faraday
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: faraday_middleware
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: activemodel
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: active_attr
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: multi_json
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: rspec
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: mocha
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: rake
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: guard-rspec
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ - !ruby/object:Gem::Dependency
159
+ name: vcr
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ - !ruby/object:Gem::Dependency
175
+ name: webmock
176
+ requirement: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ type: :development
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ - !ruby/object:Gem::Dependency
191
+ name: pry
192
+ requirement: !ruby/object:Gem::Requirement
193
+ none: false
194
+ requirements:
195
+ - - ! '>='
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
198
+ type: :development
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ! '>='
204
+ - !ruby/object:Gem::Version
205
+ version: '0'
206
+ description: web wrapper for icontact
207
+ email:
208
+ - dpickett@enlightsolutions.com
209
+ executables:
210
+ - tmux.sh
211
+ extensions: []
212
+ extra_rdoc_files: []
213
+ files:
214
+ - .gitignore
215
+ - .rspec
216
+ - .rvmrc
217
+ - .travis.yml
218
+ - Gemfile
219
+ - Guardfile
220
+ - LICENSE
221
+ - README.md
222
+ - Rakefile
223
+ - bin/tmux.sh
224
+ - i_contact.gemspec
225
+ - lib/i_contact.rb
226
+ - lib/i_contact/account.rb
227
+ - lib/i_contact/client_folder.rb
228
+ - lib/i_contact/configuration.rb
229
+ - lib/i_contact/contact.rb
230
+ - lib/i_contact/list.rb
231
+ - lib/i_contact/model.rb
232
+ - lib/i_contact/response.rb
233
+ - lib/i_contact/subscription.rb
234
+ - lib/i_contact/version.rb
235
+ - spec/cassettes/IContact_Account.yml
236
+ - spec/cassettes/IContact_ClientFolder.yml
237
+ - spec/cassettes/IContact_Contact.yml
238
+ - spec/cassettes/IContact_List.yml
239
+ - spec/cassettes/IContact_Subscription.yml
240
+ - spec/i_contact/account_spec.rb
241
+ - spec/i_contact/client_folder_spec.rb
242
+ - spec/i_contact/configuration_spec.rb
243
+ - spec/i_contact/contact_spec.rb
244
+ - spec/i_contact/list_spec.rb
245
+ - spec/i_contact/model_spec.rb
246
+ - spec/i_contact/response_spec.rb
247
+ - spec/i_contact/subscription_spec.rb
248
+ - spec/i_contact_spec.rb
249
+ - spec/spec_helper.rb
250
+ - spec/support/active_attr.rb
251
+ - spec/support/configuration.rb
252
+ - spec/support/vcr.rb
253
+ homepage: ''
254
+ licenses: []
255
+ post_install_message:
256
+ rdoc_options: []
257
+ require_paths:
258
+ - lib
259
+ required_ruby_version: !ruby/object:Gem::Requirement
260
+ none: false
261
+ requirements:
262
+ - - ! '>='
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
+ segments:
266
+ - 0
267
+ hash: 4348220470375437127
268
+ required_rubygems_version: !ruby/object:Gem::Requirement
269
+ none: false
270
+ requirements:
271
+ - - ! '>='
272
+ - !ruby/object:Gem::Version
273
+ version: '0'
274
+ segments:
275
+ - 0
276
+ hash: 4348220470375437127
277
+ requirements: []
278
+ rubyforge_project:
279
+ rubygems_version: 1.8.23
280
+ signing_key:
281
+ specification_version: 3
282
+ summary: web wrapper for icontact
283
+ test_files:
284
+ - spec/cassettes/IContact_Account.yml
285
+ - spec/cassettes/IContact_ClientFolder.yml
286
+ - spec/cassettes/IContact_Contact.yml
287
+ - spec/cassettes/IContact_List.yml
288
+ - spec/cassettes/IContact_Subscription.yml
289
+ - spec/i_contact/account_spec.rb
290
+ - spec/i_contact/client_folder_spec.rb
291
+ - spec/i_contact/configuration_spec.rb
292
+ - spec/i_contact/contact_spec.rb
293
+ - spec/i_contact/list_spec.rb
294
+ - spec/i_contact/model_spec.rb
295
+ - spec/i_contact/response_spec.rb
296
+ - spec/i_contact/subscription_spec.rb
297
+ - spec/i_contact_spec.rb
298
+ - spec/spec_helper.rb
299
+ - spec/support/active_attr.rb
300
+ - spec/support/configuration.rb
301
+ - spec/support/vcr.rb