rest-in-peace 6.0.2 → 6.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e98b14147b5fcaa949f2522f9a7a94604dd48392
4
- data.tar.gz: 4a7ca2772da4332011de1e51da52f5bbad82335f
3
+ metadata.gz: 4c4599314ea114e10d9395921b8e21da3e354b08
4
+ data.tar.gz: c434cdd4712d9f840cee88414efe160e3ce3cea3
5
5
  SHA512:
6
- metadata.gz: 7ad31db6d17f015d3a01ef7b240f838a1579d60821cae3c06d0408118b613153a0940c259014fa3bdf0a86b2a7646a1923242166be89d5b6a84fa32e7f242400
7
- data.tar.gz: 1bddaf47d37675233bbc2f891a344c85ceec7e0a088a44e85942648a11bf16eb32c851bf56bef66f67ed639c7b9a302ae077a344900d24815df3ae003bf55a26
6
+ metadata.gz: 6313f2c23659f5ddeee5f374b49758e43c7b59695cab2802cc3e6e026b920865b57e6b718abdf91e84dd6f785d902d3a102a0f96b3024396a66bb645996b5241
7
+ data.tar.gz: 8b24c6ce07f299b9bc3c26870f4b4385757be82e04eb503244ffd29afa6e397752b6a8e7d6e8f1568f6c679cc833f8d4b3bccb61bf71c9e88d753dec75457c56
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.3.3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.0.2
1
+ 6.0.3
@@ -46,6 +46,11 @@ module RESTinPeace
46
46
  valid?
47
47
  end
48
48
 
49
+ def update(attributes)
50
+ update_attributes(attributes)
51
+ save
52
+ end
53
+
49
54
  def valid?
50
55
  !errors.any?
51
56
  end
@@ -168,6 +168,27 @@ describe RESTinPeace do
168
168
  end
169
169
  end
170
170
 
171
+ describe '#update' do
172
+ let(:new_attributes) { { name: 'new_name', description: 'yoloswag' } }
173
+
174
+ subject { instance }
175
+
176
+ it 'saves record after update' do
177
+ expect(subject).to receive(:save)
178
+
179
+ subject.update(new_attributes)
180
+ end
181
+
182
+ specify do
183
+ expect { subject.update(new_attributes) }.
184
+ to change(instance, :description).from(attributes[:description]).to(new_attributes[:description])
185
+ end
186
+
187
+ specify do
188
+ expect { subject.update(new_attributes) }.to_not change(instance, :name).from(attributes[:name])
189
+ end
190
+ end
191
+
171
192
  describe 'validation handling' do
172
193
  before do
173
194
  def extended_class.model_name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-in-peace
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.2
4
+ version: 6.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raffael Schmid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-03 00:00:00.000000000 Z
11
+ date: 2017-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  version: '0'
188
188
  requirements: []
189
189
  rubyforge_project:
190
- rubygems_version: 2.5.1
190
+ rubygems_version: 2.5.2
191
191
  signing_key:
192
192
  specification_version: 4
193
193
  summary: REST in peace