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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1845d75d9389d20fd422f3b762cce42b0147df7
4
- data.tar.gz: 047293471013733919b465daed958993b2b6a57a
3
+ metadata.gz: 1018ad8769adfc0c8f21a8e26705652eb15fd827
4
+ data.tar.gz: 2b7c9a2dd0b4c5e500c37e76e5c4ed55cf6b972b
5
5
  SHA512:
6
- metadata.gz: 36c8b302b967e6090e7b886202d491dde52f7afb5870e0c8a50dd40c9b5d9602dcd64bf6b956cc2126ecf0d8a1291b8f3352b63cc7729e2eed4b1f52840b68ed
7
- data.tar.gz: a919ab898d7d0e8910a3a9a6fccb9a013478f8588bb8d0a6c41d7efa51e12bcd27981a4312175977ce34db829e4bad7257164ea3bcb733c229cdc56b8a757b63
6
+ metadata.gz: 6e3c711a81491a0112406cc18649ae16cb546b633db18739a207320d9587a39a9baf34869def9772951bf16be28470528f02c80a5a571dc10fec2bd21da912ca
7
+ data.tar.gz: 8c02998a7e094d02d267d0c2e1f06c2b05c41a0e910c6f723dcfef764a324de8d1404604232defc75d8003f6111c05fd809fa9d16e7244c0eb560b98b410f17a
@@ -1,3 +1,3 @@
1
1
  module MorseSpecHelpers
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -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.1.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-03-05 00:00:00.000000000 Z
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.5
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.