morse_spec_helpers 0.1.0 → 0.2.0
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 +12 -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: 1018ad8769adfc0c8f21a8e26705652eb15fd827
|
4
|
+
data.tar.gz: 2b7c9a2dd0b4c5e500c37e76e5c4ed55cf6b972b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e3c711a81491a0112406cc18649ae16cb546b633db18739a207320d9587a39a9baf34869def9772951bf16be28470528f02c80a5a571dc10fec2bd21da912ca
|
7
|
+
data.tar.gz: 8c02998a7e094d02d267d0c2e1f06c2b05c41a0e910c6f723dcfef764a324de8d1404604232defc75d8003f6111c05fd809fa9d16e7244c0eb560b98b410f17a
|
data/lib/morse_spec_helpers.rb
CHANGED
@@ -594,4 +594,16 @@ module MorseSpecHelpers
|
|
594
594
|
end
|
595
595
|
end
|
596
596
|
|
597
|
+
def view_allow(thing)
|
598
|
+
if thing.is_a?(Array) || thing.is_a?(ActiveRecord::Relation)
|
599
|
+
allow(view).to receive(thing.first.class.name.underscore.pluralize.to_sym).and_return(thing)
|
600
|
+
else
|
601
|
+
allow(view).to receive(thing.class.name.underscore.to_sym).and_return(thing)
|
602
|
+
end
|
603
|
+
end
|
604
|
+
|
605
|
+
def view_allow_simple_form_for(thing, f=:f)
|
606
|
+
form=SimpleForm::FormBuilder.new(thing.class, thing, self, {})
|
607
|
+
allow(view).to receive(f).and_return(form)
|
608
|
+
end
|
597
609
|
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.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Terry S
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-19 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.4.
|
81
|
+
rubygems_version: 2.4.8
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: A series of helpers to make the rspec experience nicer.
|