Sha256: bba3bdf61291586bf53ef18bfc813d281ee48f6e7cb3add1d32379ceb0eafd13

Contents?: true

Size: 1.09 KB

Versions: 8

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'
require 'generator-spec'

require_generator :cantango => :permission

RSpec::Generator.configure do |config|
  config.debug = true
  config.remove_temp_dir = true #false
  config.default_rails_root(__FILE__)
  config.lib = File.dirname(__FILE__) + '/../lib'
  config.logger = :stdout  # :file
end


describe Cantango::Generators::PermissionGenerator do
  use_helpers :model, :special, :file

  setup_generator :permission do
    tests Cantango::Generators::PermissionGenerator
  end

  describe 'Run Permission generator' do
    before :each do
      @generator = with_generator do |g|
        g.run_generator ["user"]
      end
    end

    describe 'result of running Permission generator' do
      it "should create Permission model for user" do
        @generator.should have_model :permission do |model|
          # model.should match /belongs_to :user/
        end
      end

      it "should add has_many :permissions on User model" do
        @generator.should have_model :user do |model|
          # model.should match /has_many :permissions/
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cantango-0.9.4.7 spec/generators/cantango/permission_generator_spec.rb
cantango-0.9.4.6 spec/generators/cantango/permission_generator_spec.rb
cantango-0.9.4.5 spec/generators/cantango/permission_generator_spec.rb
cantango-0.9.4.3 spec/generators/cantango/permission_generator_spec.rb
cantango-0.9.4.2 spec/generators/cantango/permission_generator_spec.rb
cantango-0.9.4.1 spec/generators/cantango/permission_generator_spec.rb
cantango-0.9.4 spec/generators/cantango/permission_generator_spec.rb
cantango-0.9.3.2 spec/generators/cantango/permission_generator_spec.rb