Sha256: 17e2fd59b1e83e22fa860f722b6b4433c908dec3d0b0eaf4edff5bf4d474d0ee

Contents?: true

Size: 1.29 KB

Versions: 12

Compression:

Stored size: 1.29 KB

Contents

require "test_helper"

class ViewsGeneratorTest < Rails::Generators::TestCase
  tests Devise::Generators::ViewsGenerator
  destination File.expand_path("../../tmp", __FILE__)
  setup :prepare_destination

  test "Assert all views are properly created with no params" do
    run_generator
    assert_files
  end

  test "Assert all views are properly created with scope param param" do
    run_generator %w(users)
    assert_files "users"

    run_generator %w(admins)
    assert_files "admins"
  end

  def assert_files(scope = nil, template_engine = nil)
    scope = "devise" if scope.nil?
    assert_file "app/views/#{scope}/confirmations/new.html.erb"
    assert_file "app/views/#{scope}/mailer/confirmation_instructions.html.erb"
    assert_file "app/views/#{scope}/mailer/reset_password_instructions.html.erb"
    assert_file "app/views/#{scope}/mailer/unlock_instructions.html.erb"
    assert_file "app/views/#{scope}/passwords/edit.html.erb"
    assert_file "app/views/#{scope}/passwords/new.html.erb"
    assert_file "app/views/#{scope}/registrations/new.html.erb"
    assert_file "app/views/#{scope}/registrations/edit.html.erb"
    assert_file "app/views/#{scope}/sessions/new.html.erb"
    assert_file "app/views/#{scope}/shared/_links.erb"
    assert_file "app/views/#{scope}/unlocks/new.html.erb"
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
devise_sociable-0.1.0 vendor/bundle/gems/devise-1.2.1/test/generators/views_generator_test.rb
devise-1.3.4 test/generators/views_generator_test.rb
devise-1.3.3 test/generators/views_generator_test.rb
devise-1.3.2 test/generators/views_generator_test.rb
devise-1.3.1 test/generators/views_generator_test.rb
devise-1.3.0 test/generators/views_generator_test.rb
devise-1.2.1 test/generators/views_generator_test.rb
devise-1.2.0 test/generators/views_generator_test.rb
devise-jdguyot-1.2.rc3 test/generators/views_generator_test.rb
devise-1.2.rc2 test/generators/views_generator_test.rb
devise-jdguyot-1.2.rc2 test/generators/views_generator_test.rb
devise-jdguyot-1.2.rc test/generators/views_generator_test.rb