ey_services_fake 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -108,8 +108,7 @@ module EyServicesFake
108
108
  message_params = JSON.parse(request.body.read)["message"]
109
109
  message_type = message_params['message_type']
110
110
  subject = message_params['subject']
111
- body = message_params['body']
112
-
111
+
113
112
  if subject.to_s.empty?
114
113
  status 400
115
114
  return {:error_messages => ["Subject can't be blank."]}.to_json
@@ -122,20 +121,18 @@ module EyServicesFake
122
121
 
123
122
  service_account = ServiceAccount.get(service_account_id)
124
123
  message = Message.create(message_params.merge(:service_account_id => service_account.id))
125
- self.class.awsm_connection.post(service_account.dashboard_notifications_url, {
126
- :notification => {:subject => subject, :body => body},
127
- :message_type => message_type,
128
- :configuration_possible => !!service_account.configuration_url,
129
- :service_name => service_account.service.name,
130
- :service_id => service_account.service_id})
124
+ forward_service_account_message_to_awsm(service_account, message)
131
125
  {}.to_json
132
126
  end
133
127
 
128
+ def forward_service_account_message_to_awsm(service_account, message)
129
+ #no-op
130
+ end
131
+
134
132
  post '/api/1/partners/:partner_id/services/:service_id/service_accounts/:service_account_id/provisioned_service/:provisioned_service_id/messages' do |partner_id, service_id, service_account_id, provisioned_service_id|
135
133
  message_params = JSON.parse(request.body.read)["message"]
136
134
  subject = message_params['subject']
137
135
  message_type = message_params['message_type']
138
- body = message_params['body']
139
136
 
140
137
  if subject.to_s.empty?
141
138
  status 400
@@ -151,14 +148,13 @@ module EyServicesFake
151
148
  provisioned_service = ProvisionedService.get(provisioned_service_id)
152
149
  service_account = provisioned_service.service_account
153
150
  message = Message.create(message_params.merge(:provisioned_service_id => provisioned_service.id))
154
- self.class.awsm_connection.post(provisioned_service.dashboard_notifications_url, {
155
- :notification => {:subject => subject, :body => body},
156
- :message_type => message_type,
157
- :configuration_possible => !!provisioned_service.configuration_url,
158
- :service_name => service_account.service.name,
159
- :provisionable_service_id => provisioned_service.id})
151
+ forward_provisioned_service_message_to_awsm(provisioned_service, message)
160
152
  {}.to_json
161
153
  end
162
154
 
155
+ def forward_provisioned_service_message_to_awsm(provisioned_service, message)
156
+ #no-op
157
+ end
158
+
163
159
  end
164
160
  end
@@ -1,3 +1,3 @@
1
1
  module EyServicesFake
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,62 +1,45 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ey_services_fake
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 0
10
- version: 0.1.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Jacob Burkhart & Josh Lane
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-11-27 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-11-28 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: sinatra
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &2156366980 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
32
22
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: cubbyhole
36
23
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *2156366980
25
+ - !ruby/object:Gem::Dependency
26
+ name: cubbyhole
27
+ requirement: &2156366400 !ruby/object:Gem::Requirement
38
28
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 23
43
- segments:
44
- - 0
45
- - 2
46
- - 0
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
47
32
  version: 0.2.0
48
33
  type: :runtime
49
- version_requirements: *id002
34
+ prerelease: false
35
+ version_requirements: *2156366400
50
36
  description: A fake for use when writting tests against the ey_services_api
51
- email:
37
+ email:
52
38
  - jacob@engineyard.com
53
39
  executables: []
54
-
55
40
  extensions: []
56
-
57
41
  extra_rdoc_files: []
58
-
59
- files:
42
+ files:
60
43
  - .gitignore
61
44
  - ey_services_fake.gemspec
62
45
  - lib/ey_services_fake/mock_backend.rb
@@ -67,38 +50,28 @@ files:
67
50
  - lib/ey_services_fake/tresfiestas_fake_rack_app.rb
68
51
  - lib/ey_services_fake/url_generator.rb
69
52
  - lib/ey_services_fake/version.rb
70
- homepage: ""
53
+ homepage: ''
71
54
  licenses: []
72
-
73
55
  post_install_message:
74
56
  rdoc_options: []
75
-
76
- require_paths:
57
+ require_paths:
77
58
  - lib
78
- required_ruby_version: !ruby/object:Gem::Requirement
59
+ required_ruby_version: !ruby/object:Gem::Requirement
79
60
  none: false
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- hash: 3
84
- segments:
85
- - 0
86
- version: "0"
87
- required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
66
  none: false
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- hash: 3
93
- segments:
94
- - 0
95
- version: "0"
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
96
71
  requirements: []
97
-
98
72
  rubyforge_project: ey_services_fake
99
73
  rubygems_version: 1.8.10
100
74
  signing_key:
101
75
  specification_version: 3
102
76
  summary: A fake for use when writting tests against the ey_services_api
103
77
  test_files: []
104
-