Sha256: 52593fab44fd4065d4aaf77ab9774495cb57aaccdf60fd96c97c3f9a011e1215
Contents?: true
Size: 1.51 KB
Versions: 11
Compression:
Stored size: 1.51 KB
Contents
require 'spec_helper' describe Redde::Generators::ScaffoldGenerator do include GeneratorSpec::TestCase destination File.expand_path("../../../tmp", __FILE__) arguments ['Articles'] before(:all) do prepare_destination run_generator end after(:all) do FileUtils.rm_rf 'tmp' end let(:args) { ["ArticleCategory"] } let(:generator) { Redde::Generators::ScaffoldGenerator.new(args) } context "METHODS" do it "gets controller_routing_path" do expect(generator.send(:controller_routing_path)).to eq "article_category" end it "gets singular_controller_routing_path" do expect(generator.send(:singular_controller_routing_path)).to eq "article_category" end it "gets model_name" do expect(generator.send(:model_name)).to eq "::ArticleCategory" end it "gets plural_model_name" do expect(generator.send(:plural_model_name)).to eq "::ArticleCategories" end it "gets resource_name" do expect(generator.send(:resource_name)).to eq "article_category" end it "gets plural_resource_name" do expect(generator.send(:plural_resource_name)).to eq "article_categories" end it "gets index header" do expect(generator.send(:index_header)).to eq "Article categories" end end # end context "METHODS" context "INTEGRATION" do it "Generates admin views" do assert_file "app/views/admin/articles/index.html.haml" assert_file "app/views/admin/articles/edit.html.haml" end end # end describe "VIEWS" end
Version data entries
11 entries across 11 versions & 1 rubygems