foundation_rails_helper 1.2.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +19 -0
- data/.rubocop_todo.yml +67 -0
- data/.travis.yml +0 -3
- data/CHANGELOG.md +9 -0
- data/README.md +2 -0
- data/Rakefile +4 -2
- data/foundation_rails_helper.gemspec +12 -11
- data/lib/foundation_rails_helper.rb +5 -5
- data/lib/foundation_rails_helper/action_view_extension.rb +1 -1
- data/lib/foundation_rails_helper/flash_helper.rb +11 -12
- data/lib/foundation_rails_helper/form_builder.rb +53 -36
- data/lib/foundation_rails_helper/version.rb +1 -1
- data/lib/railtie.rb +2 -3
- data/spec/.rubocop.yml +7 -0
- data/spec/foundation_rails_helper/configuration_spec.rb +6 -8
- data/spec/foundation_rails_helper/flash_helper_spec.rb +23 -23
- data/spec/foundation_rails_helper/form_builder_spec.rb +154 -156
- data/spec/spec_helper.rb +1 -1
- data/spec/support/.rubocop.yml +2 -0
- data/spec/support/mock_rails.rb +22 -15
- metadata +21 -2
data/spec/spec_helper.rb
CHANGED
data/spec/support/mock_rails.rb
CHANGED
@@ -28,7 +28,7 @@ module FoundationRailsSpecHelper
|
|
28
28
|
include ActionDispatch::Routing::UrlFor
|
29
29
|
|
30
30
|
def active_model_validator(kind, attributes, options = {})
|
31
|
-
validator = mock("ActiveModel::Validations::#{kind.to_s.titlecase}Validator", :
|
31
|
+
validator = mock("ActiveModel::Validations::#{kind.to_s.titlecase}Validator", attributes: attributes, options: options)
|
32
32
|
allow(validator).to receive(:kind).and_return(kind)
|
33
33
|
validator
|
34
34
|
end
|
@@ -85,9 +85,17 @@ module FoundationRailsSpecHelper
|
|
85
85
|
def mock_everything
|
86
86
|
# Resource-oriented styles like form_for(@post) will expect a path method for the object,
|
87
87
|
# so we're defining some here.
|
88
|
-
def author_path(*
|
89
|
-
|
90
|
-
|
88
|
+
def author_path(*_args)
|
89
|
+
'/authors/1'
|
90
|
+
end
|
91
|
+
|
92
|
+
def authors_path(*_args)
|
93
|
+
'/authors'
|
94
|
+
end
|
95
|
+
|
96
|
+
def new_author_path(*_args)
|
97
|
+
'/authors/new'
|
98
|
+
end
|
91
99
|
|
92
100
|
@author = ::Author.new
|
93
101
|
allow(@author).to receive(:class).and_return(::Author)
|
@@ -101,29 +109,29 @@ module FoundationRailsSpecHelper
|
|
101
109
|
allow(@author).to receive(:active).and_return(true)
|
102
110
|
allow(@author).to receive(:description).and_return('bla bla bla')
|
103
111
|
allow(@author).to receive(:avatar).and_return('avatar.png')
|
104
|
-
allow(@author).to receive(:birthdate).and_return(DateTime.parse(
|
112
|
+
allow(@author).to receive(:birthdate).and_return(DateTime.parse('1969-06-18 20:30'))
|
105
113
|
allow(@author).to receive(:id).and_return(37)
|
106
114
|
allow(@author).to receive(:new_record?).and_return(false)
|
107
115
|
allow(@author).to receive(:errors).and_return(double('errors', :[] => nil))
|
108
116
|
allow(@author).to receive(:to_key).and_return(nil)
|
109
117
|
allow(@author).to receive(:persisted?).and_return(nil)
|
110
|
-
allow(@author).to receive(:time_zone).and_return(
|
111
|
-
allow(@author).to receive(:publish_date).and_return(Date.new(
|
118
|
+
allow(@author).to receive(:time_zone).and_return('Perth')
|
119
|
+
allow(@author).to receive(:publish_date).and_return(Date.new(2000, 1, 1))
|
112
120
|
allow(@author).to receive(:forty_two).and_return(@author.birthdate + 42.years)
|
113
|
-
allow(@author).to receive(:favorite_color).and_return(
|
121
|
+
allow(@author).to receive(:favorite_color).and_return('#424242')
|
114
122
|
allow(@author).to receive(:favorite_book).and_return(nil)
|
115
123
|
|
116
124
|
@book_0 = ::Book.new
|
117
|
-
allow(@book_0).to receive(:id).and_return(
|
125
|
+
allow(@book_0).to receive(:id).and_return('78')
|
118
126
|
allow(@book_0).to receive(:title).and_return("Gulliver's Travels")
|
119
127
|
@book_1 = ::Book.new
|
120
|
-
allow(@book_1).to receive(:id).and_return(
|
121
|
-
allow(@book_1).to receive(:title).and_return(
|
128
|
+
allow(@book_1).to receive(:id).and_return('133')
|
129
|
+
allow(@book_1).to receive(:title).and_return('Treasure Island')
|
122
130
|
@genre_0 = ::Genre.new
|
123
|
-
allow(@genre_0).to receive(:name).and_return(
|
131
|
+
allow(@genre_0).to receive(:name).and_return('Exploration')
|
124
132
|
allow(@genre_0).to receive(:books).and_return([@book_0])
|
125
133
|
@genre_1 = ::Genre.new
|
126
|
-
allow(@genre_1).to receive(:name).and_return(
|
134
|
+
allow(@genre_1).to receive(:name).and_return('Pirate Exploits')
|
127
135
|
allow(@genre_1).to receive(:books).and_return([@book_1])
|
128
136
|
|
129
137
|
allow(::Author).to receive(:scoped).and_return(::Author)
|
@@ -132,7 +140,7 @@ module FoundationRailsSpecHelper
|
|
132
140
|
allow(::Author).to receive(:where).and_return([@author])
|
133
141
|
allow(::Author).to receive(:human_attribute_name) { |column_name| column_name.to_s.humanize }
|
134
142
|
allow(::Author).to receive(:human_name).and_return('::Author')
|
135
|
-
allow(::Author).to receive(:content_columns).and_return([double('column', :
|
143
|
+
allow(::Author).to receive(:content_columns).and_return([double('column', name: 'login'), double('column', name: 'created_at')])
|
136
144
|
allow(::Author).to receive(:to_key).and_return(nil)
|
137
145
|
allow(::Author).to receive(:persisted?).and_return(nil)
|
138
146
|
|
@@ -147,7 +155,6 @@ module FoundationRailsSpecHelper
|
|
147
155
|
def protect_against_forgery?
|
148
156
|
false
|
149
157
|
end
|
150
|
-
|
151
158
|
end
|
152
159
|
end
|
153
160
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foundation_rails_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastien Gruhier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -128,6 +128,20 @@ dependencies:
|
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '2.7'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: rubocop
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0.41'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0.41'
|
131
145
|
description: Rails for zurb foundation CSS framework. Form builder, flash message,
|
132
146
|
...
|
133
147
|
email:
|
@@ -138,6 +152,8 @@ extra_rdoc_files: []
|
|
138
152
|
files:
|
139
153
|
- ".gitignore"
|
140
154
|
- ".rspec"
|
155
|
+
- ".rubocop.yml"
|
156
|
+
- ".rubocop_todo.yml"
|
141
157
|
- ".travis.yml"
|
142
158
|
- CHANGELOG.md
|
143
159
|
- CONTRIBUTING.md
|
@@ -153,10 +169,12 @@ files:
|
|
153
169
|
- lib/foundation_rails_helper/form_builder.rb
|
154
170
|
- lib/foundation_rails_helper/version.rb
|
155
171
|
- lib/railtie.rb
|
172
|
+
- spec/.rubocop.yml
|
156
173
|
- spec/foundation_rails_helper/configuration_spec.rb
|
157
174
|
- spec/foundation_rails_helper/flash_helper_spec.rb
|
158
175
|
- spec/foundation_rails_helper/form_builder_spec.rb
|
159
176
|
- spec/spec_helper.rb
|
177
|
+
- spec/support/.rubocop.yml
|
160
178
|
- spec/support/mock_rails.rb
|
161
179
|
homepage: http://github.com/sgruhier/foundation_rails_helper
|
162
180
|
licenses:
|
@@ -187,5 +205,6 @@ test_files:
|
|
187
205
|
- spec/foundation_rails_helper/flash_helper_spec.rb
|
188
206
|
- spec/foundation_rails_helper/form_builder_spec.rb
|
189
207
|
- spec/spec_helper.rb
|
208
|
+
- spec/support/.rubocop.yml
|
190
209
|
- spec/support/mock_rails.rb
|
191
210
|
has_rdoc:
|