polleverywhere-cops 1.1.0 → 1.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: 1b6628dcdc0949ab8a9a4c961e344b535069f610
4
- data.tar.gz: 0f91e16f0da73b121b83b11c091720156592e158
3
+ metadata.gz: 7913672b2b360707923e231046ee3eede74a07fe
4
+ data.tar.gz: 94779a03f3ca7d87a23dcf0001b3911925120c93
5
5
  SHA512:
6
- metadata.gz: 2e0208d41d0f39cb125cebfec70724d2d47db9e229df366335a433c43b5fe788c460dfcaf10eb827cbdcaf70a1ead9bb5fec7480e1f21a35ccc7265ee378c279
7
- data.tar.gz: a827b5bbe9930667bc197666c5b0352b7a6e160cb286a083a3b3a6a59499b919567b189b716b537fb7b474c1e2d89212b7b06ce777dfacb7809fe750f96a71d0
6
+ metadata.gz: 13bfdb335a3c9f6decb4aaafb7eebc0bbb2b5fcd16f6daec2556dac79fbb26fede8797eab3f9ca3398132cc20abe05b67908c2e9deec855a867d9291e81f11f2
7
+ data.tar.gz: 782401cd2d8262c2b1fd9102f6947e5f63a49e481b84419aeee520457061d78570efdf35759d5354e13e3a0e840adfd311bf40ff78451aa4d8b94d3973af5a15
data/README.md CHANGED
@@ -4,8 +4,9 @@ Custom RuboCop cops for Poll Everywhere
4
4
 
5
5
  ## Cops
6
6
 
7
- - *NullableBoolean*: Boolean database columns cannot be nullable.
7
+ - _NullableBoolean_: Boolean database columns cannot be nullable.
8
8
  - _Constantize_: Don't call String#constantize.
9
+ - _RenderViews_: Don't call `render_views` in controller specs.
9
10
 
10
11
  ## Instructions
11
12
 
@@ -4,3 +4,4 @@ require "rubocop/polleverywhere/version"
4
4
  # cops
5
5
  require "rubocop/cop/polleverywhere/nullable_boolean"
6
6
  require "rubocop/cop/polleverywhere/constantize"
7
+ require "rubocop/cop/polleverywhere/render_views"
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module PollEverywhere
6
+ class RenderViews < Cop
7
+ MSG = 'Do not use `render_views` in controller tests because it is an order of magnitude slower. If view rendering needs to be tested, write a different type of test.'.freeze
8
+
9
+ def_node_matcher :render_views?, <<-PATTERN
10
+ (send nil? :render_views)
11
+ PATTERN
12
+
13
+ def on_send(node)
14
+ return unless render_views?(node)
15
+
16
+ add_offense(node, location: :selector)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module PollEverywhere
5
5
  module Version
6
- STRING = "1.1.0".freeze
6
+ STRING = "1.2.0".freeze
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polleverywhere-cops
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Poll Everywhere
@@ -40,6 +40,7 @@ files:
40
40
  - lib/polleverywhere-cops.rb
41
41
  - lib/rubocop/cop/polleverywhere/constantize.rb
42
42
  - lib/rubocop/cop/polleverywhere/nullable_boolean.rb
43
+ - lib/rubocop/cop/polleverywhere/render_views.rb
43
44
  - lib/rubocop/polleverywhere/version.rb
44
45
  - polleverywhere-cops.gemspec
45
46
  homepage: https://github.com/polleverywhere/polleverywhere-cops