fulcrum 0.1.4 → 0.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.
- data/lib/fulcrum/version.rb +1 -1
- data/spec/lib/choice_list_spec.rb +4 -3
- data/spec/lib/classification_set_spec.rb +4 -3
- data/spec/lib/form_spec.rb +4 -3
- data/spec/lib/photo_spec.rb +4 -3
- data/spec/lib/record_spec.rb +4 -3
- metadata +2 -2
data/lib/fulcrum/version.rb
CHANGED
@@ -64,9 +64,9 @@ describe Fulcrum::ChoiceList do
|
|
64
64
|
context '#delete' do
|
65
65
|
it 'should return deleted choice_list with status 200' do
|
66
66
|
cl_id = 'abc'
|
67
|
-
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/choice_lists/#{cl_id}.json").to_return(:status =>
|
67
|
+
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/choice_lists/#{cl_id}.json").to_return(:status => 204, :body => '{"choice_list":{}}')
|
68
68
|
c = Fulcrum::ChoiceList.delete(cl_id)
|
69
|
-
Fulcrum::ChoiceList.response.status.should eq(
|
69
|
+
Fulcrum::ChoiceList.response.status.should eq(204)
|
70
70
|
c = JSON.parse(c)
|
71
71
|
c.keys.should include('choice_list')
|
72
72
|
c['choice_list'].should be_a(Hash)
|
@@ -110,10 +110,11 @@ describe Fulcrum::ChoiceList do
|
|
110
110
|
context '#delete' do
|
111
111
|
it 'should receive a 404 response' do
|
112
112
|
cl_id = 'abc'
|
113
|
-
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/choice_lists/#{cl_id}.json").to_return(:status => 404)
|
113
|
+
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/choice_lists/#{cl_id}.json").to_return(:status => 404, :body => { :message => "error message"})
|
114
114
|
c = Fulcrum::ChoiceList.delete(cl_id)
|
115
115
|
c.keys.should include(:error)
|
116
116
|
c[:error][:status].should eq(404)
|
117
|
+
c[:error][:message].should eq({ :message => "error message" })
|
117
118
|
end
|
118
119
|
end
|
119
120
|
end
|
@@ -64,9 +64,9 @@ describe Fulcrum::ClassificationSet do
|
|
64
64
|
context '#delete' do
|
65
65
|
it 'should return deleted classification_set with status 200' do
|
66
66
|
cs_id = 'abc'
|
67
|
-
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/classification_sets/#{cs_id}.json").to_return(:status =>
|
67
|
+
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/classification_sets/#{cs_id}.json").to_return(:status => 204, :body => '{"classification_set":{}}')
|
68
68
|
c = Fulcrum::ClassificationSet.delete(cs_id)
|
69
|
-
Fulcrum::ClassificationSet.response.status.should eq(
|
69
|
+
Fulcrum::ClassificationSet.response.status.should eq(204)
|
70
70
|
c = JSON.parse(c)
|
71
71
|
c.keys.should include('classification_set')
|
72
72
|
c['classification_set'].should be_a(Hash)
|
@@ -109,10 +109,11 @@ describe Fulcrum::ClassificationSet do
|
|
109
109
|
context '#delete' do
|
110
110
|
it 'should receive a 404 response' do
|
111
111
|
cs_id = 'abc'
|
112
|
-
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/classification_sets/#{cs_id}.json").to_return(:status => 404)
|
112
|
+
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/classification_sets/#{cs_id}.json").to_return(:status => 404, :body => { :message => "error message"})
|
113
113
|
c = Fulcrum::ClassificationSet.delete(cs_id)
|
114
114
|
c.keys.should include(:error)
|
115
115
|
c[:error][:status].should eq(404)
|
116
|
+
c[:error][:message].should eq({ :message => "error message" })
|
116
117
|
end
|
117
118
|
end
|
118
119
|
end
|
data/spec/lib/form_spec.rb
CHANGED
@@ -65,9 +65,9 @@ describe Fulcrum::Form do
|
|
65
65
|
context '#delete' do
|
66
66
|
it 'should return deleted form with status 200' do
|
67
67
|
form_id = 'abc'
|
68
|
-
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/forms/#{form_id}.json").to_return(:status =>
|
68
|
+
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/forms/#{form_id}.json").to_return(:status => 204, :body => '{"form":{}}')
|
69
69
|
f = Fulcrum::Form.delete(form_id)
|
70
|
-
Fulcrum::Form.response.status.should eq(
|
70
|
+
Fulcrum::Form.response.status.should eq(204)
|
71
71
|
f = JSON.parse(f)
|
72
72
|
f.keys.should include('form')
|
73
73
|
f['form'].should be_a(Hash)
|
@@ -110,10 +110,11 @@ describe Fulcrum::Form do
|
|
110
110
|
context '#delete' do
|
111
111
|
it 'should receive a 404 response' do
|
112
112
|
form_id = 'abc'
|
113
|
-
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/forms/#{form_id}.json").to_return(:status => 404)
|
113
|
+
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/forms/#{form_id}.json").to_return(:status => 404, :body => { :message => "error message"})
|
114
114
|
c = Fulcrum::Form.delete(form_id)
|
115
115
|
c.keys.should include(:error)
|
116
116
|
c[:error][:status].should eq(404)
|
117
|
+
c[:error][:message].should eq({ :message => "error message" })
|
117
118
|
end
|
118
119
|
end
|
119
120
|
end
|
data/spec/lib/photo_spec.rb
CHANGED
@@ -40,9 +40,9 @@ describe Fulcrum::Photo do
|
|
40
40
|
context '#delete' do
|
41
41
|
it 'should delete the photo and return status 200' do
|
42
42
|
photo_id = 'abc'
|
43
|
-
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/photos/#{photo_id}.json").to_return(:status =>
|
43
|
+
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/photos/#{photo_id}.json").to_return(:status => 204, :body => '{"photo":{}}')
|
44
44
|
r = Fulcrum::Photo.delete(photo_id)
|
45
|
-
Fulcrum::Photo.response.status.should eq(
|
45
|
+
Fulcrum::Photo.response.status.should eq(204)
|
46
46
|
r = JSON.parse(r)
|
47
47
|
r.keys.should include('photo')
|
48
48
|
r['photo'].should be_a(Hash)
|
@@ -84,10 +84,11 @@ describe Fulcrum::Photo do
|
|
84
84
|
context '#delete' do
|
85
85
|
it 'should receive a 404 response' do
|
86
86
|
photo_id = 'abc'
|
87
|
-
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/photos/#{photo_id}.json").to_return(:status => 404)
|
87
|
+
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/photos/#{photo_id}.json").to_return(:status => 404, :body => { :message => "error message"})
|
88
88
|
p = Fulcrum::Photo.delete(photo_id)
|
89
89
|
p.keys.should include(:error)
|
90
90
|
p[:error][:status].should eq(404)
|
91
|
+
p[:error][:message].should eq({ :message => "error message" })
|
91
92
|
end
|
92
93
|
end
|
93
94
|
end
|
data/spec/lib/record_spec.rb
CHANGED
@@ -65,9 +65,9 @@ describe Fulcrum::Record do
|
|
65
65
|
context '#delete' do
|
66
66
|
it 'should delete the record and return status 200' do
|
67
67
|
record_id = 'abc'
|
68
|
-
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/records/#{record_id}.json").to_return(:status =>
|
68
|
+
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/records/#{record_id}.json").to_return(:status => 204, :body => '{"record":{}}')
|
69
69
|
r = Fulcrum::Record.delete(record_id)
|
70
|
-
Fulcrum::Record.response.status.should eq(
|
70
|
+
Fulcrum::Record.response.status.should eq(204)
|
71
71
|
r = JSON.parse(r)
|
72
72
|
r.keys.should include('record')
|
73
73
|
r['record'].should be_a(Hash)
|
@@ -110,10 +110,11 @@ describe Fulcrum::Record do
|
|
110
110
|
context '#delete' do
|
111
111
|
it 'should receive a 404 response' do
|
112
112
|
record_id = 'abc'
|
113
|
-
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/records/#{record_id}.json").to_return(:status => 404)
|
113
|
+
stub_request(:delete, "#{Fulcrum::Api.configuration.uri}/records/#{record_id}.json").to_return(:status => 404, :body => { :message => "error message"})
|
114
114
|
r = Fulcrum::Record.delete(record_id)
|
115
115
|
r.keys.should include(:error)
|
116
116
|
r[:error][:status].should eq(404)
|
117
|
+
r[:error][:message].should eq({ :message => "error message" })
|
117
118
|
end
|
118
119
|
end
|
119
120
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fulcrum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|