g5_updatable 0.5.0 → 0.5.1
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.
- checksums.yaml +4 -4
- data/app/controllers/g5_updatable/syncs_controller.rb +7 -1
- data/app/models/g5_updatable/client.rb +0 -1
- data/app/models/g5_updatable/location.rb +3 -0
- data/lib/g5_updatable/locations_updater.rb +2 -2
- data/lib/g5_updatable/version.rb +1 -1
- data/spec/controllers/syncs_controller_spec.rb +18 -8
- data/spec/dummy/log/test.log +8740 -0
- data/spec/lib/g5_updatable/locations_updater_spec.rb +12 -0
- data/spec/models/g5_updatable/location_spec.rb +19 -0
- metadata +2 -2
@@ -51,5 +51,17 @@ describe G5Updatable::LocationsUpdater do
|
|
51
51
|
its(:urn) { should eq("urn") }
|
52
52
|
its(:name) { should eq("Location Name") }
|
53
53
|
end
|
54
|
+
|
55
|
+
context "with an existing identical Location record" do
|
56
|
+
before do
|
57
|
+
loc = FactoryGirl.create(:location, uid: uid, urn: "urn", client_uid: "client_uid", name: "Location Name", properties: properties)
|
58
|
+
@original_updated_at = subject.updated_at
|
59
|
+
updater.update
|
60
|
+
end
|
61
|
+
|
62
|
+
it "updates its timestamp" do
|
63
|
+
expect(subject.reload.updated_at).to be > @original_updated_at
|
64
|
+
end
|
65
|
+
end
|
54
66
|
end
|
55
67
|
end
|
@@ -24,4 +24,23 @@ describe G5Updatable::Location do
|
|
24
24
|
|
25
25
|
it { should eq(client) }
|
26
26
|
end
|
27
|
+
|
28
|
+
|
29
|
+
context "scopes" do
|
30
|
+
let!(:location) { FactoryGirl.create(:location) }
|
31
|
+
let!(:location2) {FactoryGirl.create(:location, client_uid: "something_else") }
|
32
|
+
|
33
|
+
describe ".by_client_uid" do
|
34
|
+
it "returns locations" do
|
35
|
+
expect(described_class.by_client_uid(location.client_uid)).to eq [location]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe ".max_updated_at" do
|
40
|
+
it "returns locations" do
|
41
|
+
expect(described_class.max_updated_at.to_s).to eq location2.updated_at.to_s
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
27
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: g5_updatable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|