Sha256: c965d98525f5d7a102709677ac2f8c261bcf97c2d39e50f35a53e1de49db8884
Contents?: true
Size: 1.38 KB
Versions: 2
Compression:
Stored size: 1.38 KB
Contents
require 'spec_helper' # Generators are not automatically loaded by Rails require 'generators/rspec/view/view_generator' describe Rspec::Generators::ViewGenerator do # Tell the generator where to put its output (what it thinks of as Rails.root) destination File.expand_path("../../../../../tmp", __FILE__) before { prepare_destination } describe 'with default template engine' do it 'generates a spec for the supplied action' do run_generator %w(posts index) file('spec/views/posts/index.html.erb_spec.rb').tap do |f| expect(f).to contain(/require 'spec_helper'/) expect(f).to contain(/describe "posts\/index"/) end end describe 'with a nested resource' do it 'generates a spec for the supplied action' do run_generator %w(admin/posts index) file('spec/views/admin/posts/index.html.erb_spec.rb').tap do |f| expect(f).to contain(/require 'spec_helper'/) expect(f).to contain(/describe "admin\/posts\/index"/) end end end end describe 'with a specified template engine' do it 'generates a spec for the supplied action' do run_generator %w(posts index --template_engine haml) file('spec/views/posts/index.html.haml_spec.rb').tap do |f| expect(f).to contain(/require 'spec_helper'/) expect(f).to contain(/describe "posts\/index"/) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rspec-rails-3.0.0.beta2 | spec/generators/rspec/view/view_generator_spec.rb |
rspec-rails-2.99.0.beta2 | spec/generators/rspec/view/view_generator_spec.rb |