url_attributes 1.2.0 → 1.3.0
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/lib/url_attributes/rspec/have_url_attribute.rb +7 -1
- data/lib/url_attributes/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 46228fafa354d1bb8a052b28309de6845da16597
|
|
4
|
+
data.tar.gz: 534f5019b9493149941acd874a138536dfd10777
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0872af40f92a9b85838587fc215e3cc1d58f6605fd0fc1bf127954246b4d37a7114e39788cd3e35a427143964eba4aaf4bca9e896a8d884c76704e1dae24c74d
|
|
7
|
+
data.tar.gz: 846b2809c85afc4f388b35071f66e81ce7180fb56d88e091b19fe4da40f3ed123a07f6f1f339db4e28c5df052ee7c99538534bec4d54f1b381db3566f46ebb51
|
|
@@ -9,7 +9,11 @@ if defined?(RSpec)
|
|
|
9
9
|
model.valid?
|
|
10
10
|
test_1 = !model.errors[attribute_name].include?("is not a valid URL")
|
|
11
11
|
model.send :"#{attribute_name}=", "nohttp.com"
|
|
12
|
-
|
|
12
|
+
if @checked_before
|
|
13
|
+
model.run_callbacks @checked_before
|
|
14
|
+
else
|
|
15
|
+
model.run_callbacks :save
|
|
16
|
+
end
|
|
13
17
|
test_2 = model.send(attribute_name) == "http://nohttp.com"
|
|
14
18
|
test_0 && test_1 && test_2
|
|
15
19
|
end
|
|
@@ -17,5 +21,7 @@ if defined?(RSpec)
|
|
|
17
21
|
failure_message do |model|
|
|
18
22
|
"expected that #{model} would have a URL attribute called #{attribute_name}, but it doesn't look like a URL"
|
|
19
23
|
end
|
|
24
|
+
|
|
25
|
+
chain(:checked_before) { |callback| @checked_before = callback }
|
|
20
26
|
end
|
|
21
27
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: url_attributes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- George Millo
|
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
189
189
|
version: '0'
|
|
190
190
|
requirements: []
|
|
191
191
|
rubyforge_project:
|
|
192
|
-
rubygems_version: 2.4.
|
|
192
|
+
rubygems_version: 2.4.3
|
|
193
193
|
signing_key:
|
|
194
194
|
specification_version: 4
|
|
195
195
|
summary: Simple URL attributes for ActiveRecord
|