morse_spec_helpers 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/morse_spec_helpers/version.rb +1 -1
- data/lib/morse_spec_helpers.rb +16 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1f254943bb6c5c50fbdf4c60e204dd06bbb7fcd
|
4
|
+
data.tar.gz: d3d1126477ffdd07bcba3607889c62291e1d6c83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a2dc5c557e2b35b88cf37cba40917619b55fac91adf1b9a7d6d29d4ca0134562cf1c5bcee750badf0bd316c0c9d956300a178d9ff9a81834e9b52a21c5bdc94
|
7
|
+
data.tar.gz: eab3593c35064ce2951d2b226acaac58d8e22806196146447748c07ab14170d42f1e33b9aec63d791e5de2e8b349eb640890881a4db1c2a0c111f21283a24db6
|
data/lib/morse_spec_helpers.rb
CHANGED
@@ -529,9 +529,25 @@ module MorseSpecHelpers
|
|
529
529
|
expect(@instance).to be_valid
|
530
530
|
end
|
531
531
|
end
|
532
|
+
|
532
533
|
def should_not_be_valid
|
533
534
|
it "should not be valid" do
|
534
535
|
expect(@instance).to_not be_valid
|
535
536
|
end
|
536
537
|
end
|
538
|
+
|
539
|
+
def there_can_be_only_one(thing)
|
540
|
+
it "should allow only one #{thing}" do
|
541
|
+
model=@instance.class
|
542
|
+
model_for_factory_girl=model.to_s.underscore
|
543
|
+
thing1=FactoryGirl.create model_for_factory_girl, thing=>true
|
544
|
+
thing2=FactoryGirl.create model_for_factory_girl, thing=>false
|
545
|
+
thing2.update_attribute(thing,true)
|
546
|
+
thing2.save
|
547
|
+
thing1.reload
|
548
|
+
expect(thing1.send(thing)).to be_falsey
|
549
|
+
expect(thing2.send(thing)).to be_truthy
|
550
|
+
end
|
551
|
+
end
|
552
|
+
|
537
553
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: morse_spec_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Terry S
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
requirements: []
|
80
80
|
rubyforge_project:
|
81
|
-
rubygems_version: 2.
|
81
|
+
rubygems_version: 2.4.5
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: A series of helpers to make the rspec experience nicer.
|