cadun 0.5.4 → 0.5.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.
data/lib/cadun/config.rb CHANGED
@@ -1,19 +1,9 @@
1
1
  module Cadun
2
- class Config
3
- include Singleton
4
-
5
- attr_accessor :config
6
-
7
- def initialize
8
- @config = {}
9
- end
10
-
2
+ class Config
11
3
  def self.load_file(path)
12
- instance.config = YAML::load_file(path)
13
- end
14
-
15
- def self.method_missing(method, *args)
16
- instance.config['cadun'][method.to_s]
4
+ (class << self; self; end).instance_eval do
5
+ YAML::load_file(path)['cadun'].each { |key, value| define_method(key) { value } }
6
+ end
17
7
  end
18
8
  end
19
9
  end
@@ -0,0 +1,39 @@
1
+ module Cadun
2
+ class Gateway
3
+ attr_reader :opts
4
+
5
+ def self.provision(user_id, service_id)
6
+ RestClient.put("#{Config.restclient_url}/service/provisionamento", "{\"usuarioId\": \"#{user_id}\", \"servicoId\": \"#{service_id}\"}", :content_type => "text/javascript").code == 200
7
+ end
8
+
9
+ def initialize(opts = {})
10
+ @opts = opts
11
+ end
12
+
13
+ def content
14
+ @content ||= Hash.from_xml(content_resource)["pessoa"]
15
+ end
16
+
17
+ def content_resource
18
+ subject = if opts[:email]; "email/#{opts[:email]}"
19
+ elsif opts[:cadun_id]; opts[:cadun_id]
20
+ else
21
+ raise RestClient::Unauthorized unless authorization["status"] == "AUTORIZADO"
22
+ authorization["usuarioID"]
23
+ end
24
+
25
+ RestClient.get("#{Config.auth_url}/cadunii/ws/resources/pessoa/#{subject}", :content_type => "text/xml")
26
+ end
27
+
28
+ def authorization
29
+ @authorization ||= Hash.from_xml(authorization_resource)["usuarioAutorizado"]
30
+ end
31
+
32
+ def authorization_resource
33
+ %w(glb_id ip service_id).each { |i| raise ArgumentError.new("#{i} is missing") unless opts[i.to_sym] }
34
+ authorization_data = { "glbId" => opts[:glb_id], "ip" => opts[:ip], "servicoID" => opts[:service_id] }.to_xml(:root => "usuarioAutorizado", :indent => 0)
35
+
36
+ RestClient.put("#{Config.auth_url}/ws/rest/autorizacao", authorization_data, :content_type => "text/xml")
37
+ end
38
+ end
39
+ end
data/lib/cadun/user.rb CHANGED
@@ -1,17 +1,13 @@
1
1
  module Cadun
2
- class User
3
- attr_reader :authorization_gateway, :provisioning_gateway
4
-
5
- { "id" => "cadun_id",
6
- "nome" => "name",
7
- "emailPrincipal" => "email",
8
- "tipoUsuario" => "user_type",
9
- "sexo" => "gender",
10
- "bairro" => "neighborhood",
11
- "cep" => "zipcode",
12
- "complemento" => "complement" }.each do |path, method|
13
- define_method(method) { authorization_gateway.content[path] }
14
- end
2
+ class User
3
+ { "id" => "cadun_id",
4
+ "nome" => "name",
5
+ "emailPrincipal" => "email",
6
+ "tipoUsuario" => "user_type",
7
+ "sexo" => "gender",
8
+ "bairro" => "neighborhood",
9
+ "cep" => "zipcode",
10
+ "complemento" => "complement" }.each { |path, method| define_method(method) { gateway.content[path] } }
15
11
 
16
12
  alias :id :cadun_id
17
13
 
@@ -25,8 +21,7 @@ module Cadun
25
21
  end
26
22
 
27
23
  def initialize(options = {})
28
- @authorization_gateway = Gateway::Authorization.new(options)
29
- @provisioning_gateway = Gateway::Provisioning.new(options)
24
+ @options = options
30
25
  end
31
26
 
32
27
  def address
@@ -58,15 +53,19 @@ module Cadun
58
53
  end
59
54
 
60
55
  def to_hash
61
- %w(cadun_id name email user_type gender neighborhood city state country address birthday phone mobile login cpf zipcode status complement).inject(Hash.new(0)) { |hash, method| hash[method.to_sym] = send(method); hash }
56
+ %w(address birthday cadun_id city complement country cpf email gender login mobile name neighborhood phone state status user_type zipcode).inject(Hash.new(0)) { |hash, method| hash[method.to_sym] = send(method); hash }
62
57
  end
63
58
 
64
59
  def provision_to_service(service_id)
65
- provisioning_gateway.provision(self.id, service_id)
60
+ Gateway.provision(id, service_id)
66
61
  end
67
62
 
68
63
  def method_missing(method)
69
- authorization_gateway.content[method.to_s]
64
+ gateway.content[method.to_s]
65
+ end
66
+
67
+ def gateway
68
+ @gateway ||= Gateway.new(@options)
70
69
  end
71
70
  end
72
71
  end
data/lib/cadun/version.rb CHANGED
@@ -2,7 +2,7 @@ module Cadun
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- PATCH = 4
5
+ PATCH = 5
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH] * '.'
8
8
  end
data/lib/cadun.rb CHANGED
@@ -1,10 +1,8 @@
1
1
  require 'date'
2
2
  require 'yaml'
3
- require 'singleton'
4
3
  require 'rest_client'
5
4
  require 'json'
6
5
  require 'active_support/core_ext/hash'
7
- require "#{File.dirname(__FILE__)}/cadun/gateway/authorization"
8
- require "#{File.dirname(__FILE__)}/cadun/gateway/provisioning"
6
+ require "#{File.dirname(__FILE__)}/cadun/gateway"
9
7
  require "#{File.dirname(__FILE__)}/cadun/user"
10
8
  require "#{File.dirname(__FILE__)}/cadun/config"
@@ -0,0 +1,91 @@
1
+ require 'spec_helper'
2
+
3
+ describe Cadun::Gateway do
4
+ before { load_config }
5
+
6
+ describe "#provision" do
7
+ context "when the service is provisioned to the user" do
8
+ before { FakeWeb.register_uri(:put, "http://cadun-rest.qa01.globoi.com/service/provisionamento", :status => 200) }
9
+
10
+ subject { Cadun::Gateway.provision(123456, 2515) }
11
+ specify { should be_true }
12
+ end
13
+
14
+ context "when the service is provisioned to the user" do
15
+ before { FakeWeb.register_uri(:put, "http://cadun-rest.qa01.globoi.com/service/provisionamento", :status => 304) }
16
+
17
+ subject { Cadun::Gateway.provision(123456, 2515) }
18
+ it { proc { subject }.should raise_error(RestClient::NotModified) }
19
+ end
20
+
21
+ context "when the service is not found" do
22
+ before { FakeWeb.register_uri(:put, "http://cadun-rest.qa01.globoi.com/service/provisionamento", :status => 404) }
23
+
24
+ subject { Cadun::Gateway.provision(123456, 2515) }
25
+ it { proc { subject }.should raise_error(RestClient::ResourceNotFound) }
26
+ end
27
+
28
+ context "when the service is not found" do
29
+ before { FakeWeb.register_uri(:put, "http://cadun-rest.qa01.globoi.com/service/provisionamento", :status => 503) }
30
+
31
+ subject { Cadun::Gateway.provision(123456, 2515) }
32
+ it { proc { subject }.should raise_error(RestClient::ServiceUnavailable) }
33
+ end
34
+
35
+ end
36
+
37
+ describe "#content" do
38
+ let(:gateway) { Cadun::Gateway.new(:glb_id => "GLB_ID", :ip => "127.0.0.1", :service_id => 2626) }
39
+
40
+ context "when status not AUTORIZADO" do
41
+ before do
42
+ FakeWeb.register_uri(:put, "http://isp-authenticator.qa01.globoi.com:8280/ws/rest/autorizacao", :body => "<?xml version='1.0' encoding='utf-8'?><usuarioAutorizado><status>NAO_AUTORIZADO</status><usuarioID>1</usuarioID></usuarioAutorizado>")
43
+ end
44
+
45
+ it { proc { gateway.content }.should raise_error(RestClient::Unauthorized) }
46
+ end
47
+
48
+ context "when status AUTORIZADO" do
49
+ before do
50
+ FakeWeb.register_uri(:put, "http://isp-authenticator.qa01.globoi.com:8280/ws/rest/autorizacao", :body => "<?xml version='1.0' encoding='utf-8'?><usuarioAutorizado><status>AUTORIZADO</status><usuarioID>1</usuarioID></usuarioAutorizado>")
51
+ FakeWeb.register_uri(:get, "http://isp-authenticator.qa01.globoi.com:8280/cadunii/ws/resources/pessoa/1", :body => "<?xml version='1.0' encoding='utf-8'?><pessoa><nome>Barack Obama</nome></pessoa>")
52
+ end
53
+
54
+ it { proc { gateway.content }.should_not raise_error(RestClient::Unauthorized) }
55
+
56
+ it "should parse the resource" do
57
+ gateway.content['nome'].should == 'Barack Obama'
58
+ end
59
+ end
60
+ end
61
+
62
+ describe "#authorization" do
63
+ context "when all information is given" do
64
+ let(:gateway) { Cadun::Gateway.new(:glb_id => "GLB_ID", :ip => "127.0.0.1", :service_id => 2626) }
65
+
66
+ before do
67
+ FakeWeb.register_uri(:put, "http://isp-authenticator.qa01.globoi.com:8280/ws/rest/autorizacao", :body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?><usuarioAutorizado><glbId>GLB_ID</glbId><ip>127.0.0.1</ip><servicoID type=\"integer\">2626</servicoID></usuarioAutorizado>", :body => "<?xml version='1.0' encoding='utf-8'?><usuarioAutorizado><status>AUTORIZADO</status><usuarioID>1</usuarioID></usuarioAutorizado>")
68
+ end
69
+
70
+ it "should parse the authorization request" do
71
+ gateway.authorization['usuarioID'].should == '1'
72
+ end
73
+
74
+ end
75
+
76
+ context "when glb_id is not given" do
77
+ let(:gateway) { Cadun::Gateway.new }
78
+ it { proc { gateway.authorization }.should raise_error(ArgumentError, "glb_id is missing") }
79
+ end
80
+
81
+ context "when ip is not given" do
82
+ let(:gateway) { Cadun::Gateway.new(:glb_id => "1") }
83
+ it { proc { gateway.authorization }.should raise_error(ArgumentError, "ip is missing") }
84
+ end
85
+
86
+ context "when service_id is not given" do
87
+ let(:gateway) { Cadun::Gateway.new(:glb_id => "1", :ip => "1") }
88
+ it { proc { gateway.authorization }.should raise_error(ArgumentError, "service_id is missing") }
89
+ end
90
+ end
91
+ end
@@ -17,8 +17,16 @@ describe Cadun::User do
17
17
  context "when the user id is not given" do
18
18
  subject { Cadun::User.new :ip => "127.0.0.1", :service_id => 2626, :glb_id => "GLB_ID" }
19
19
 
20
- it "should load the gateway" do
21
- mock(Cadun::Gateway::Authorization).new(hash_including(:ip => "127.0.0.1", :service_id => 2626, :glb_id => "GLB_ID"))
20
+ it "should load the gateway only when it's needed" do
21
+ mock(Cadun::Gateway).new(hash_including(:ip => "127.0.0.1", :service_id => 2626, :glb_id => "GLB_ID")) do
22
+ mock(Cadun::Gateway).content { Hash.new }
23
+ end
24
+
25
+ subject.login
26
+ end
27
+
28
+ it "should not load the gateway when the user is initialized" do
29
+ dont_allow(Cadun::Gateway).new
22
30
  subject
23
31
  end
24
32
 
@@ -84,7 +92,7 @@ describe Cadun::User do
84
92
 
85
93
  describe "#provision_to_service" do
86
94
  it "should call gateway's provision" do
87
- mock(Cadun::Gateway::Provisioning).new(anything) { mock('gateway').provision(1, 6969) }
95
+ mock(Cadun::Gateway).provision(1, 6969)
88
96
 
89
97
  user = Cadun::User.new
90
98
  mock(user).id { 1 }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cadun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-07-27 00:00:00.000000000Z
14
+ date: 2011-07-28 00:00:00.000000000Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
18
- requirement: &2153540860 !ruby/object:Gem::Requirement
18
+ requirement: &2156848880 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 3.0.0
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *2153540860
26
+ version_requirements: *2156848880
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: builder
29
- requirement: &2153540360 !ruby/object:Gem::Requirement
29
+ requirement: &2156848380 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 2.1.2
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *2153540360
37
+ version_requirements: *2156848380
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: rest-client
40
- requirement: &2153539980 !ruby/object:Gem::Requirement
40
+ requirement: &2156848000 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0'
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *2153539980
48
+ version_requirements: *2156848000
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: json
51
- requirement: &2153539520 !ruby/object:Gem::Requirement
51
+ requirement: &2156847540 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: '0'
57
57
  type: :runtime
58
58
  prerelease: false
59
- version_requirements: *2153539520
59
+ version_requirements: *2156847540
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: i18n
62
- requirement: &2153539100 !ruby/object:Gem::Requirement
62
+ requirement: &2156847120 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ! '>='
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: '0'
68
68
  type: :runtime
69
69
  prerelease: false
70
- version_requirements: *2153539100
70
+ version_requirements: *2156847120
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rake
73
- requirement: &2153538680 !ruby/object:Gem::Requirement
73
+ requirement: &2156846700 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ! '>='
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: '0'
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *2153538680
81
+ version_requirements: *2156846700
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: rspec
84
- requirement: &2153538260 !ruby/object:Gem::Requirement
84
+ requirement: &2156846280 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,10 +89,10 @@ dependencies:
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
- version_requirements: *2153538260
92
+ version_requirements: *2156846280
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: rr
95
- requirement: &2153537840 !ruby/object:Gem::Requirement
95
+ requirement: &2156845860 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
98
98
  - - ! '>='
@@ -100,10 +100,10 @@ dependencies:
100
100
  version: '0'
101
101
  type: :development
102
102
  prerelease: false
103
- version_requirements: *2153537840
103
+ version_requirements: *2156845860
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: fakeweb
106
- requirement: &2153537420 !ruby/object:Gem::Requirement
106
+ requirement: &2156845440 !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements:
109
109
  - - ! '>='
@@ -111,7 +111,7 @@ dependencies:
111
111
  version: '0'
112
112
  type: :development
113
113
  prerelease: false
114
- version_requirements: *2153537420
114
+ version_requirements: *2156845440
115
115
  description: A wrapper for the Globo.com's authentication/authorization API
116
116
  email:
117
117
  - bruno@azisaka.com.br
@@ -126,15 +126,13 @@ files:
126
126
  - cadun.gemspec
127
127
  - lib/cadun.rb
128
128
  - lib/cadun/config.rb
129
- - lib/cadun/gateway/authorization.rb
130
- - lib/cadun/gateway/provisioning.rb
129
+ - lib/cadun/gateway.rb
131
130
  - lib/cadun/user.rb
132
131
  - lib/cadun/version.rb
133
132
  - script/console
134
133
  - script/loader.rb
135
134
  - spec/cadun/config_spec.rb
136
- - spec/cadun/gateway/authorization_spec.rb
137
- - spec/cadun/gateway/provisioning_spec.rb
135
+ - spec/cadun/gateway_spec.rb
138
136
  - spec/cadun/user_spec.rb
139
137
  - spec/spec_helper.rb
140
138
  - spec/support/fixtures/another_config.yml
@@ -1,43 +0,0 @@
1
- module Cadun
2
- module Gateway
3
- class Authorization
4
- attr_reader :options, :connection
5
-
6
- def initialize(options = {})
7
- @options = options
8
- end
9
-
10
- def content
11
- @content ||= Hash.from_xml(content_resource)["pessoa"]
12
- end
13
-
14
- def authorization
15
- @authorization ||= Hash.from_xml(authorization_resource)["usuarioAutorizado"]
16
- end
17
-
18
- protected
19
- def content_resource
20
- subject = if options[:email]
21
- "email/#{options[:email]}"
22
-
23
- elsif options[:cadun_id]
24
- options[:cadun_id]
25
-
26
- else
27
- raise RuntimeError.new "not authorized" unless authorization["status"] == "AUTORIZADO"
28
- authorization["usuarioID"]
29
- end
30
-
31
- RestClient.get("#{Config.auth_url}/cadunii/ws/resources/pessoa/#{subject}", :content_type => "text/xml")
32
- end
33
-
34
- def authorization_resource
35
- [:glb_id, :ip, :service_id].each { |arg| raise RuntimeError.new("#{arg} is missing") unless options[arg] }
36
-
37
- authorization_data = { "glbId" => options[:glb_id], "ip" => options[:ip], "servicoID" => options[:service_id] }.to_xml(:root => "usuarioAutorizado", :indent => 0)
38
-
39
- RestClient.put("#{Config.auth_url}/ws/rest/autorizacao", authorization_data, :content_type => "text/xml")
40
- end
41
- end
42
- end
43
- end
@@ -1,13 +0,0 @@
1
- module Cadun
2
- module Gateway
3
- class Provisioning < Authorization
4
- def provision(user_id, service_id)
5
- begin
6
- RestClient.put("#{Config.restclient_url}/service/provisionamento", "{\"usuarioId\": \"#{user_id}\", \"servicoId\": \"#{service_id}\"}", :content_type => "text/javascript").code == 200
7
- rescue RestClient::NotModified
8
- false
9
- end
10
- end
11
- end
12
- end
13
- end
@@ -1,64 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Cadun::Gateway::Authorization do
4
- let(:response) { mock }
5
-
6
- before do
7
- load_config
8
- end
9
-
10
- describe "#content" do
11
- let(:gateway) { Cadun::Gateway::Authorization.new(:glb_id => "GLB_ID", :ip => "127.0.0.1", :service_id => 2626) }
12
-
13
- context "when status not AUTORIZADO" do
14
- before do
15
- FakeWeb.register_uri(:put, "http://isp-authenticator.qa01.globoi.com:8280/ws/rest/autorizacao", :body => "<?xml version='1.0' encoding='utf-8'?><usuarioAutorizado><status>NAO_AUTORIZADO</status><usuarioID>1</usuarioID></usuarioAutorizado>")
16
- end
17
-
18
- it { proc { gateway.content }.should raise_error(RuntimeError, "not authorized") }
19
- end
20
-
21
- context "when status AUTORIZADO" do
22
- before do
23
- FakeWeb.register_uri(:put, "http://isp-authenticator.qa01.globoi.com:8280/ws/rest/autorizacao", :body => "<?xml version='1.0' encoding='utf-8'?><usuarioAutorizado><status>AUTORIZADO</status><usuarioID>1</usuarioID></usuarioAutorizado>")
24
- FakeWeb.register_uri(:get, "http://isp-authenticator.qa01.globoi.com:8280/cadunii/ws/resources/pessoa/1", :body => "<?xml version='1.0' encoding='utf-8'?><pessoa><nome>Barack Obama</nome></pessoa>")
25
- end
26
-
27
- it { proc { gateway.content }.should_not raise_error(RuntimeError, "not authorized") }
28
-
29
- it "should parse the resource" do
30
- gateway.content['nome'].should == 'Barack Obama'
31
- end
32
- end
33
- end
34
-
35
- describe "#authorization" do
36
- context "when all information is given" do
37
- let(:gateway) { Cadun::Gateway::Authorization.new(:glb_id => "GLB_ID", :ip => "127.0.0.1", :service_id => 2626) }
38
-
39
- before do
40
- FakeWeb.register_uri(:put, "http://isp-authenticator.qa01.globoi.com:8280/ws/rest/autorizacao", :body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?><usuarioAutorizado><glbId>GLB_ID</glbId><ip>127.0.0.1</ip><servicoID type=\"integer\">2626</servicoID></usuarioAutorizado>", :body => "<?xml version='1.0' encoding='utf-8'?><usuarioAutorizado><status>AUTORIZADO</status><usuarioID>1</usuarioID></usuarioAutorizado>")
41
- end
42
-
43
- it "should parse the authorization request" do
44
- gateway.authorization['usuarioID'].should == '1'
45
- end
46
-
47
- end
48
-
49
- context "when glb_id is not given" do
50
- let(:gateway) { Cadun::Gateway::Authorization.new }
51
- it { proc { gateway.authorization }.should raise_error(RuntimeError, "glb_id is missing") }
52
- end
53
-
54
- context "when ip is not given" do
55
- let(:gateway) { Cadun::Gateway::Authorization.new(:glb_id => "1") }
56
- it { proc { gateway.authorization }.should raise_error(RuntimeError, "ip is missing") }
57
- end
58
-
59
- context "when service_id is not given" do
60
- let(:gateway) { Cadun::Gateway::Authorization.new(:glb_id => "1", :ip => "1") }
61
- it { proc { gateway.authorization }.should raise_error(RuntimeError, "service_id is missing") }
62
- end
63
- end
64
- end
@@ -1,27 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Cadun::Gateway::Provisioning do
4
- before { load_config }
5
-
6
- describe "#provision" do
7
- let(:gateway) { Cadun::Gateway::Provisioning.new }
8
-
9
- context "when the service is provisioned to the user" do
10
- before do
11
- FakeWeb.register_uri(:put, "http://cadun-rest.qa01.globoi.com/service/provisionamento", :status => 200)
12
- end
13
-
14
- subject { gateway.provision(123456, 2515) }
15
- specify { should be_true }
16
- end
17
-
18
- context "when the service is provisioned to the user" do
19
- before do
20
- FakeWeb.register_uri(:put, "http://cadun-rest.qa01.globoi.com/service/provisionamento", :status => 304)
21
- end
22
-
23
- subject { gateway.provision(123456, 2515) }
24
- specify { should be_false }
25
- end
26
- end
27
- end