rspec-rails 2.99.0.beta1 → 2.99.0.beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. checksums.yaml +8 -8
  2. data/Changelog.md +18 -0
  3. data/features/controller_specs/capybara.feature +44 -0
  4. data/features/controller_specs/render_views.feature +1 -1
  5. data/lib/autotest/rails_rspec2.rb +1 -0
  6. data/lib/generators/rspec/install/templates/spec/spec_helper.rb.tt +0 -1
  7. data/lib/generators/rspec/integration/integration_generator.rb +3 -2
  8. data/lib/generators/rspec/scaffold/scaffold_generator.rb +3 -2
  9. data/lib/rspec/rails/adapters.rb +12 -5
  10. data/lib/rspec/rails/example/controller_example_group.rb +2 -1
  11. data/lib/rspec/rails/example/view_example_group.rb +3 -0
  12. data/lib/rspec/rails/matchers/have_extension.rb +1 -0
  13. data/lib/rspec/rails/matchers/relation_match_array.rb +1 -1
  14. data/lib/rspec/rails/matchers/routing_matchers.rb +4 -0
  15. data/lib/rspec/rails/mocks.rb +22 -0
  16. data/lib/rspec/rails/vendor/capybara.rb +35 -4
  17. data/lib/rspec/rails/version.rb +1 -1
  18. data/spec/autotest/rails_rspec2_spec.rb +5 -5
  19. data/spec/generators/rspec/controller/controller_generator_spec.rb +16 -16
  20. data/spec/generators/rspec/helper/helper_generator_spec.rb +4 -4
  21. data/spec/generators/rspec/install/install_generator_spec.rb +4 -4
  22. data/spec/generators/rspec/integration/integration_generator_spec.rb +18 -5
  23. data/spec/generators/rspec/mailer/mailer_generator_spec.rb +11 -11
  24. data/spec/generators/rspec/model/model_generator_spec.rb +7 -7
  25. data/spec/generators/rspec/observer/observer_generator_spec.rb +3 -3
  26. data/spec/generators/rspec/scaffold/scaffold_generator_spec.rb +46 -34
  27. data/spec/generators/rspec/view/view_generator_spec.rb +6 -6
  28. data/spec/rspec/rails/assertion_adapter_spec.rb +3 -3
  29. data/spec/rspec/rails/configuration_spec.rb +2 -2
  30. data/spec/rspec/rails/deprecations_spec.rb +1 -1
  31. data/spec/rspec/rails/example/controller_example_group_spec.rb +47 -21
  32. data/spec/rspec/rails/example/feature_example_group_spec.rb +2 -2
  33. data/spec/rspec/rails/example/helper_example_group_spec.rb +12 -12
  34. data/spec/rspec/rails/example/mailer_example_group_spec.rb +3 -3
  35. data/spec/rspec/rails/example/model_example_group_spec.rb +3 -3
  36. data/spec/rspec/rails/example/request_example_group_spec.rb +5 -5
  37. data/spec/rspec/rails/example/routing_example_group_spec.rb +5 -5
  38. data/spec/rspec/rails/example/view_example_group_spec.rb +44 -29
  39. data/spec/rspec/rails/extensions/active_model/errors_on_spec.rb +3 -3
  40. data/spec/rspec/rails/fixture_support_spec.rb +3 -3
  41. data/spec/rspec/rails/matchers/be_a_new_spec.rb +17 -17
  42. data/spec/rspec/rails/matchers/be_new_record_spec.rb +2 -2
  43. data/spec/rspec/rails/matchers/be_routable_spec.rb +8 -8
  44. data/spec/rspec/rails/matchers/be_valid_spec.rb +3 -4
  45. data/spec/rspec/rails/matchers/errors_on_spec.rb +12 -12
  46. data/spec/rspec/rails/matchers/has_spec.rb +1 -1
  47. data/spec/rspec/rails/matchers/have_rendered_spec.rb +3 -3
  48. data/spec/rspec/rails/matchers/redirect_to_spec.rb +7 -6
  49. data/spec/rspec/rails/matchers/relation_match_array_spec.rb +5 -5
  50. data/spec/rspec/rails/matchers/route_to_spec.rb +21 -21
  51. data/spec/rspec/rails/minitest_lifecycle_adapter_spec.rb +9 -0
  52. data/spec/rspec/rails/mocks/mock_model_spec.rb +80 -57
  53. data/spec/rspec/rails/mocks/stub_model_spec.rb +23 -23
  54. data/spec/rspec/rails/setup_and_teardown_adapter_spec.rb +4 -4
  55. data/spec/rspec/rails/view_rendering_spec.rb +14 -14
  56. data/spec/spec_helper.rb +1 -0
  57. data/spec/support/helpers.rb +15 -1
  58. metadata +29 -13
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzMxYzE1NGZhMDdhYTFkNTc5Y2MyNTU1M2IxMWUyOGY1MzMwZTU5NA==
4
+ YzY3ODRlMWU4ZjJkNDI5NjU1M2NhZGM2ZTJjM2EyMGUzYjdkMDFhNA==
5
5
  data.tar.gz: !binary |-
6
- ODA5YjFlY2UzYjk0YTNhNTkwMmE2ZTBhMDZjNWU5OGI4NTY3YzFmYQ==
6
+ ODJlYTA0ZTU4M2NlOWJhMzU1NDk3NjJhMDAzNDNjMTJlYjg1MzQyMw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MWQwNDc3ZjhkNzI2Zjc5YzU1YjJhOWRjMmJhNDJkODQ4YTE4MjBlMzY1YWE2
10
- YzI5MjQ1ZjJjNDg2MDQyMzA5YTFhMTQ1OTE0ZDllOTYyMjliZmZhOTU2MDI0
11
- MmQzNGUwNTZjZWM1NGViNzAxOGY4YjgxMTI1OTQ4OTZhN2FlMDk=
9
+ YWU5ZWVhNWFiYzdiZWY1ZWQ0OWYyMjEyZTIwOTJjZDIxODBjM2Q1ZTljMDg1
10
+ MTdhYzFjZjlhYjBhNjlmNTk1YTFkMGU1YTk0M2ZjM2NmMDE5NTNlOTI0MmQ3
11
+ OGVhMDRjZjRjNjI2NWJkZGY3YzU2Yjc3ZGI0NTM1YjFkYzU4MDQ=
12
12
  data.tar.gz: !binary |-
13
- OWM4ZGMwODc0NTRlNDYwNjNmYWQ5MmM3ZTVmMTY3ODVjNjY4M2IzNGI4MTA4
14
- N2E2MmU2OGE1NDZjYTZhYjU1ZDM1MjAxOTUwMmMxZGY4ODgxMGEwZmQzOGJh
15
- MTBkZjBlNjYwOWVkN2JiOTFiZjMxNmQ4ODgxYTAyZWEyODkwNzY=
13
+ OGJjZTRhNWZjMWQyMGUzYzcyNzc5OTNjZWVkMTVjMDBjZWJmN2NjNjQ0NWJh
14
+ ZTk2M2M4MTVkNWJkMTliZDY2YWViODIwNDIwYzRlOTMzOTVmNjJjZTIzYTc3
15
+ Yjg4ZWFhZDY5OTEyZmE3N2Y0ZGVhMmIwYmQ3NmFmOTVhYmZmYmE=
@@ -1,3 +1,21 @@
1
+ ### 2.99.0.beta2 / 2014-02-17
2
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.99.0.beta1...v2.99.0.beta2)
3
+
4
+ Bug fixes
5
+
6
+ * Use `__send__` rather than `send` to prevent naming collisions (Bradley Schaefer)
7
+ * Supports Rails 4.1. (Andy Lindeman)
8
+ * Loads ActiveSupport properly to support changes in Rails 4.1. (Andy Lindeman)
9
+ * Anonymous controllers inherit from `ActionController::Base` if `ApplicationController`
10
+ is not present. (Jon Rowe)
11
+
12
+ Deprecations
13
+
14
+ * Deprecates the `--webrat` option to the scaffold and request spec generator (Andy Lindeman)
15
+ * Deprecates the use of `Capybara::DSL` (e.g., `visit`) in controller specs.
16
+ It is more appropriate to use capybara in feature specs (`spec/features`)
17
+ instead. (Andy Lindeman)
18
+
1
19
  ### 2.99.0.beta1 / 2013-11-07
2
20
  [full changelog](http://github.com/rspec/rspec-rails/compare/v2.14.0...v2.99.0.beta1)
3
21
 
@@ -0,0 +1,44 @@
1
+ Feature: use of capybara in controller specs
2
+
3
+ In RSpec 2.x, capybara's DSL was automatically available in controller
4
+ specs. In RSpec 3.x, capybara is no longer available in controller specs
5
+ automatically.
6
+
7
+ To continue using capybara's DSL in controller specs, include
8
+ `Capybara::DSL` explicitly.
9
+
10
+ Scenario: Capybara::DSL methods are available, but raise deprecation warnings
11
+ Given a file named "spec/controllers/widgets_controller_spec.rb" with:
12
+ """ruby
13
+ require "spec_helper"
14
+
15
+ describe WidgetsController do
16
+ describe "GET index" do
17
+ it "says 'Listing widgets'" do
18
+ expect(RSpec).to receive(:deprecate)
19
+ visit "/widgets"
20
+ end
21
+ end
22
+ end
23
+ """
24
+ When I run `rspec spec`
25
+ Then the examples should all pass
26
+
27
+ Scenario: include Capybara::DSL methods explicitly
28
+ Given a file named "spec/controllers/widgets_controller_spec.rb" with:
29
+ """ruby
30
+ require "spec_helper"
31
+
32
+ describe WidgetsController do
33
+ include Capybara::DSL
34
+
35
+ describe "GET index" do
36
+ it "says 'Listing widgets'" do
37
+ expect(RSpec).not_to receive(:deprecate)
38
+ visit "/widgets"
39
+ end
40
+ end
41
+ end
42
+ """
43
+ When I run `rspec spec`
44
+ Then the examples should all pass
@@ -71,7 +71,7 @@ Feature: render_views
71
71
  end
72
72
  end
73
73
  """
74
- When I run `rspec spec --order default --format documentation`
74
+ When I run `rspec spec --order defined --format documentation`
75
75
  Then the output should contain:
76
76
  """ruby
77
77
  WidgetsController
@@ -25,6 +25,7 @@ rescue LoadError
25
25
 
26
26
  $:.push(*Dir["vendor/rails/*/lib"])
27
27
 
28
+ require 'active_support'
28
29
  require 'active_support/core_ext'
29
30
  require 'autotest/rspec2'
30
31
 
@@ -2,7 +2,6 @@
2
2
  ENV["RAILS_ENV"] ||= 'test'
3
3
  require File.expand_path("../../config/environment", __FILE__)
4
4
  require 'rspec/rails'
5
- require 'rspec/autorun'
6
5
 
7
6
  # Requires supporting ruby files with custom matchers and macros, etc,
8
7
  # in spec/support/ and its subdirectories.
@@ -10,15 +10,16 @@ module Rspec
10
10
  def generate_request_spec
11
11
  return unless options[:request_specs]
12
12
 
13
+ RSpec.deprecate("the --webrat-matchers option", :replacement => nil) if options[:webrat_matchers]
14
+ RSpec.deprecate("the --webrat option", :replacement => nil) if options[:webrat]
15
+
13
16
  template 'request_spec.rb',
14
17
  File.join('spec/requests', class_path, "#{table_name}_spec.rb")
15
18
  end
16
19
 
17
20
  protected
18
21
 
19
- # @deprecated Use `--webrat` instead.
20
22
  def webrat?
21
- RSpec.deprecate("the --webrat-matchers option", :replacement => "--webrat") if options[:webrat_matchers]
22
23
  options[:webrat] || options[:webrat_matchers]
23
24
  end
24
25
 
@@ -22,6 +22,9 @@ module Rspec
22
22
  def generate_controller_spec
23
23
  return unless options[:controller_specs]
24
24
 
25
+ RSpec.deprecate("the --webrat-matchers option", :replacement => nil) if options[:webrat_matchers]
26
+ RSpec.deprecate("the --webrat option", :replacement => nil) if options[:webrat]
27
+
25
28
  template 'controller_spec.rb',
26
29
  File.join('spec/controllers', controller_class_path, "#{controller_file_name}_controller_spec.rb")
27
30
  end
@@ -46,9 +49,7 @@ module Rspec
46
49
 
47
50
  protected
48
51
 
49
- # @deprecated Use `--webrat` instead.
50
52
  def webrat?
51
- RSpec.deprecate("--webrat-matchers", :replacement => "--webrat") if options[:webrat_matchers]
52
53
  options[:webrat] || options[:webrat_matchers]
53
54
  end
54
55
 
@@ -1,4 +1,5 @@
1
1
  require 'delegate'
2
+ require 'active_support'
2
3
  require 'active_support/concern'
3
4
 
4
5
  module RSpec
@@ -8,7 +9,13 @@ module RSpec
8
9
  require 'minitest/assertions'
9
10
  Assertions = Minitest::Assertions
10
11
  else
11
- require 'test/unit/assertions'
12
+ begin
13
+ require 'test/unit/assertions'
14
+ rescue LoadError
15
+ # work around for Rubinius not having a std std-lib
16
+ require 'rubysl-test-unit' if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
17
+ require 'test/unit/assertions'
18
+ end
12
19
  Assertions = Test::Unit::Assertions
13
20
  end
14
21
 
@@ -101,10 +108,10 @@ module RSpec
101
108
  # hooks.
102
109
  def setup(*methods)
103
110
  methods.each do |method|
104
- if method.to_s =~ /^setup_(fixtures|controller_request_and_response)$/
105
- prepend_before { send method }
111
+ if method.to_s =~ /^setup_(with_controller|fixtures|controller_request_and_response)$/
112
+ prepend_before { __send__ method }
106
113
  else
107
- before { send method }
114
+ before { __send__ method }
108
115
  end
109
116
  end
110
117
  end
@@ -114,7 +121,7 @@ module RSpec
114
121
  # Wraps `teardown` calls from within Rails' testing framework in
115
122
  # `after` hooks.
116
123
  def teardown(*methods)
117
- methods.each { |method| after { send method } }
124
+ methods.each { |method| after { __send__ method } }
118
125
  end
119
126
  end
120
127
 
@@ -55,9 +55,10 @@ module RSpec::Rails
55
55
  # # ....
56
56
  # end
57
57
  def controller(base_class = nil, &body)
58
+ root_controller = defined?(ApplicationController) ? ApplicationController : ActionController::Base
58
59
  base_class ||= RSpec.configuration.infer_base_class_for_anonymous_controllers? ?
59
60
  controller_class :
60
- ApplicationController
61
+ root_controller
61
62
 
62
63
  metadata[:example_group][:described_class] = Class.new(base_class) do
63
64
  def self.name; "AnonymousController"; end
@@ -152,6 +152,9 @@ module RSpec::Rails
152
152
  view.lookup_context.prefixes << _controller_path
153
153
  end
154
154
 
155
+ # fixes bug with differing formats
156
+ view.lookup_context.view_paths.each(&:clear_cache)
157
+
155
158
  controller.controller_path = _controller_path
156
159
  controller.request.path_parameters[:controller] = _controller_path
157
160
  controller.request.path_parameters[:action] = _inferred_action unless _inferred_action =~ /^_/
@@ -1,3 +1,4 @@
1
+ require 'active_support'
1
2
  require 'active_support/core_ext/module/aliasing'
2
3
  require 'rspec/matchers/built_in/have'
3
4
 
@@ -1,3 +1,3 @@
1
1
  if defined?(ActiveRecord::Relation)
2
- RSpec::Matchers::OperatorMatcher.register(ActiveRecord::Relation, '=~', RSpec::Matchers::BuiltIn::MatchArray)
2
+ RSpec::Matchers::BuiltIn::OperatorMatcher.register(ActiveRecord::Relation, '=~', RSpec::Matchers::BuiltIn::MatchArray)
3
3
  end
@@ -35,6 +35,10 @@ module RSpec::Rails::Matchers
35
35
  rescued_exception.message
36
36
  end
37
37
 
38
+ def failure_message_for_should_not
39
+ "expected #{@actual.inspect} not to route to #{@expected.inspect}"
40
+ end
41
+
38
42
  def description
39
43
  "route #{@actual.inspect} to #{@expected.inspect}"
40
44
  end
@@ -1,3 +1,5 @@
1
+ require 'active_support'
2
+ require 'active_support/deprecation'
1
3
  require 'active_support/core_ext'
2
4
  require 'active_model'
3
5
 
@@ -29,6 +31,19 @@ module RSpec
29
31
  end
30
32
  end
31
33
 
34
+ # Starting with Rails 4.1, ActiveRecord associations are inversible
35
+ # by default. This class represents an association from the mocked
36
+ # model's perspective.
37
+ #
38
+ # @private
39
+ class Association
40
+ attr_accessor :target, :inversed
41
+
42
+ def initialize(association_name)
43
+ @association_name = association_name
44
+ end
45
+ end
46
+
32
47
  module ActiveRecordInstanceMethods
33
48
  # Stubs `persisted?` to return `false` and `id` to return `nil`.
34
49
  def destroy
@@ -45,6 +60,13 @@ module RSpec
45
60
  def new_record?
46
61
  !persisted?
47
62
  end
63
+
64
+ # Returns an object representing an association from the mocked
65
+ # model's perspective. For use by Rails internally only.
66
+ def association(association_name)
67
+ @associations ||= Hash.new { |h, k| h[k] = Association.new(k) }
68
+ @associations[association_name]
69
+ end
48
70
  end
49
71
 
50
72
  # Creates a test double representing `string_or_model_class` with common
@@ -9,9 +9,42 @@ rescue LoadError
9
9
  end
10
10
 
11
11
  if defined?(Capybara)
12
+ module RSpec::Rails::DeprecatedCapybaraDSL
13
+ include ::Capybara::DSL
14
+
15
+ def self.included(mod)
16
+ mod.extend(ClassMethods)
17
+ super
18
+ end
19
+
20
+ module ClassMethods
21
+ def include(mod)
22
+ if mod == ::Capybara::DSL
23
+ class_variable_set(:@@_rspec_capybara_included_explicitly, true)
24
+ end
25
+
26
+ super
27
+ end
28
+ end
29
+
30
+ ::Capybara::DSL.instance_methods(false).each do |method|
31
+ # capybara internally calls `page`, skip to avoid a duplicate
32
+ # deprecation warning
33
+ next if method.to_s == 'page'
34
+
35
+ define_method method do |*args, &blk|
36
+ unless self.class.class_variable_defined?(:@@_rspec_capybara_included_explicitly)
37
+ RSpec.deprecate "Using the capybara method `#{method}` in controller specs",
38
+ :replacement => "feature specs (spec/features)"
39
+ end
40
+ super(*args, &blk)
41
+ end
42
+ end
43
+ end
44
+
12
45
  RSpec.configure do |c|
13
46
  if defined?(Capybara::DSL)
14
- c.include Capybara::DSL, :type => :controller
47
+ c.include ::RSpec::Rails::DeprecatedCapybaraDSL, :type => :controller
15
48
  c.include Capybara::DSL, :type => :feature
16
49
  end
17
50
 
@@ -20,9 +53,7 @@ if defined?(Capybara)
20
53
  c.include Capybara::RSpecMatchers, :type => :helper
21
54
  c.include Capybara::RSpecMatchers, :type => :mailer
22
55
  c.include Capybara::RSpecMatchers, :type => :controller
23
- c.include Capybara::RSpecMatchers, :example_group => {
24
- :file_path => c.escaped_path(%w[spec features])
25
- }
56
+ c.include Capybara::RSpecMatchers, :type => :feature
26
57
  end
27
58
 
28
59
  unless defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL)
@@ -1,7 +1,7 @@
1
1
  module RSpec
2
2
  module Rails
3
3
  module Version
4
- STRING = '2.99.0.beta1'
4
+ STRING = '2.99.0.beta2'
5
5
  end
6
6
  end
7
7
  end
@@ -9,26 +9,26 @@ describe Autotest::RailsRspec2 do
9
9
  let(:exceptions_regexp) { rails_rspec2_autotest.exceptions }
10
10
 
11
11
  it "matches './log/test.log'" do
12
- exceptions_regexp.should match('./log/test.log')
12
+ expect(exceptions_regexp).to match('./log/test.log')
13
13
  end
14
14
 
15
15
  it "matches 'log/test.log'" do
16
- exceptions_regexp.should match('log/test.log')
16
+ expect(exceptions_regexp).to match('log/test.log')
17
17
  end
18
18
 
19
19
  it "does not match './spec/models/user_spec.rb'" do
20
- exceptions_regexp.should_not match('./spec/models/user_spec.rb')
20
+ expect(exceptions_regexp).not_to match('./spec/models/user_spec.rb')
21
21
  end
22
22
 
23
23
  it "does not match 'spec/models/user_spec.rb'" do
24
- exceptions_regexp.should_not match('spec/models/user_spec.rb')
24
+ expect(exceptions_regexp).not_to match('spec/models/user_spec.rb')
25
25
  end
26
26
  end
27
27
 
28
28
  describe 'mappings' do
29
29
  it 'runs model specs when support files change' do
30
30
  rails_rspec2_autotest.find_order = %w(spec/models/user_spec.rb spec/support/blueprints.rb)
31
- rails_rspec2_autotest.test_files_for('spec/support/blueprints.rb').should(
31
+ expect(rails_rspec2_autotest.test_files_for('spec/support/blueprints.rb')).to(
32
32
  include('spec/models/user_spec.rb'))
33
33
  end
34
34
  end
@@ -17,16 +17,16 @@ describe Rspec::Generators::ControllerGenerator do
17
17
  end
18
18
 
19
19
  describe 'the spec' do
20
- it { should exist }
21
- it { should contain(/require 'spec_helper'/) }
22
- it { should contain(/describe PostsController/) }
20
+ it { is_expected.to exist }
21
+ it { is_expected.to contain(/require 'spec_helper'/) }
22
+ it { is_expected.to contain(/describe PostsController/) }
23
23
  end
24
24
  end
25
25
  describe 'skipped with a flag' do
26
26
  before do
27
27
  run_generator %w(posts --no-controller_specs)
28
28
  end
29
- it { should_not exist }
29
+ it { is_expected.not_to exist }
30
30
  end
31
31
  end
32
32
 
@@ -38,7 +38,7 @@ describe Rspec::Generators::ControllerGenerator do
38
38
  end
39
39
  describe 'index.html.erb' do
40
40
  subject { file('spec/views/posts/index.html.erb_spec.rb') }
41
- it { should_not exist }
41
+ it { is_expected.not_to exist }
42
42
  end
43
43
  end
44
44
  describe 'with no actions' do
@@ -47,7 +47,7 @@ describe Rspec::Generators::ControllerGenerator do
47
47
  end
48
48
  describe 'index.html.erb' do
49
49
  subject { file('spec/views/posts/index.html.erb_spec.rb') }
50
- it { should_not exist }
50
+ it { is_expected.not_to exist }
51
51
  end
52
52
  end
53
53
 
@@ -58,7 +58,7 @@ describe Rspec::Generators::ControllerGenerator do
58
58
 
59
59
  describe 'index.html.erb' do
60
60
  subject { file('spec/views/posts/index.html._spec.rb') }
61
- it { should_not exist }
61
+ it { is_expected.not_to exist }
62
62
  end
63
63
  end
64
64
  end
@@ -70,15 +70,15 @@ describe Rspec::Generators::ControllerGenerator do
70
70
  end
71
71
  describe 'index.html.erb' do
72
72
  subject { file('spec/views/posts/index.html.erb_spec.rb') }
73
- it { should exist }
74
- it { should contain(/require 'spec_helper'/) }
75
- it { should contain(/describe "posts\/index.html.erb"/) }
73
+ it { is_expected.to exist }
74
+ it { is_expected.to contain(/require 'spec_helper'/) }
75
+ it { is_expected.to contain(/describe "posts\/index.html.erb"/) }
76
76
  end
77
77
  describe 'show.html.erb' do
78
78
  subject { file('spec/views/posts/show.html.erb_spec.rb') }
79
- it { should exist }
80
- it { should contain(/require 'spec_helper'/) }
81
- it { should contain(/describe "posts\/show.html.erb"/) }
79
+ it { is_expected.to exist }
80
+ it { is_expected.to contain(/require 'spec_helper'/) }
81
+ it { is_expected.to contain(/describe "posts\/show.html.erb"/) }
82
82
  end
83
83
  end
84
84
  describe 'with haml' do
@@ -87,9 +87,9 @@ describe Rspec::Generators::ControllerGenerator do
87
87
  end
88
88
  describe 'index.html.haml' do
89
89
  subject { file('spec/views/posts/index.html.haml_spec.rb') }
90
- it { should exist }
91
- it { should contain(/require 'spec_helper'/) }
92
- it { should contain(/describe "posts\/index.html.haml"/) }
90
+ it { is_expected.to exist }
91
+ it { is_expected.to contain(/require 'spec_helper'/) }
92
+ it { is_expected.to contain(/describe "posts\/index.html.haml"/) }
93
93
  end
94
94
  end
95
95
  end