Sha256: 7b3d8de6890a447557e36e12cd257074807ef1235df7bf28b4213a789aa09b47

Contents?: true

Size: 496 Bytes

Versions: 6

Compression:

Stored size: 496 Bytes

Contents

require 'test_helper'

class <%= class_name %>Test < ActiveSupport::TestCase
  context "new record" do
    setup do
      @<%= singular_name %> = Factory :<%= singular_name %>
    end
    
    should_change "<%= class_name %>.count", :by => 1
  end
  
  # Mass assignment attributes
  should_allow_mass_assignment_of <%= attributes.map(&:name).map { |a| ':'+a }.join(', ') %>
  should_not_allow_mass_assignment_of :id<% unless options[:skip_timestamps] %>, :created_at, :modified_at<% end %>
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jzajpt-blueberry_scaffold-0.1.0 generators/blueberry_scaffold/templates/model_test.rb
jzajpt-blueberry_scaffold-0.1.1 generators/blueberry_scaffold/templates/model_test.rb
jzajpt-blueberry_scaffold-0.2.1 generators/blueberry_scaffold/templates/model_test.rb
jzajpt-blueberry_scaffold-0.3.0 generators/blueberry_scaffold/templates/model_test.rb
jzajpt-blueberry_scaffold-0.3.1 generators/blueberry_scaffold/templates/model_test.rb
jzajpt-blueberry_scaffold-0.3.2 generators/blueberry_scaffold/templates/model_test.rb