Sha256: a46bf035963a1d7d07eb476b01a30fad92b0dccf1291927d1d8aa587d5022897

Contents?: true

Size: 1.26 KB

Versions: 16

Compression:

Stored size: 1.26 KB

Contents

require "rails_helper"

<% attributes.each do |pair| %>
RSpec.describe ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>, '.<%= pair.split(":")[0] %>', :type => :model do
	describe "Attributes" do
		it "does not save when attribute is nil" do
			#<%= resource_singular %> = FactoryGirl.build(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>, :<%= pair.split(":")[0] %> => nil)
			#expect(<%= resource_singular %>.save).to equal(false)
		end
		it "does not save when <%= pair %> is ..." do
			#expect(<%= resource_singular %>.save).to equal(false)
		end
	end
end
<% end %>
RSpec.describe ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>, :type => :model do
	describe "Dependencies" do
		before(:example) do
			@<%= resource_singular %> = FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
		end
		it "deletes ... when deleted" do

		end
	end
end
RSpec.describe ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>, :type => :model do
	describe "Callbacks" do
		before(:example) do
    	@<%= resource_singular %> = FactoryGirl.create(:<%= module_snake %>_<%= resource_singular %>_<%= api_version %>)
  	end
		it "creates a ..." do
			#expect(object.posts.nil?).to equal(false) 	
		end
	end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
json_voorhees-1.5.1 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-1.5.0 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-1.4.9 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-1.4.8 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-1.4.7 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-1.4.6 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-1.4.5 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-1.4.2 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-1.4.1 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-1.4.0 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-1.3.2 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-1.3.1 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-1.3.0 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-1.0.0 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-0.5.5 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb
json_voorhees-0.5.4 lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb