Sha256: fadae45ef239cc05a4db769e709bb99e1fbd8446935ce0f14841f570f649d152
Contents?: true
Size: 1.08 KB
Versions: 8
Compression:
Stored size: 1.08 KB
Contents
class <%= pluralize camelize(name) %>ControllerTest < FunctionalTestCase def setup <%= module_name %>::<%= camelize name %>.delete_all end def test_get_<%= name %>_by_id <%= name %> = <%= camelize name %>Factory.post get "/<%= pluralize name %>/#{<%= name %>._id}" assert_equal 200, last_response.status end def test_get_<%= pluralize name %> 3.times { <%= camelize name %>Factory.post } get "/<%= pluralize name %>" assert_equal 200, last_response.status end def test_post_<%= pluralize name %> post "/<%= pluralize name %>", to_json(<%= camelize name %>Factory.attrs) assert_equal 201, last_response.status end def test_patch_<%= name %>_by_id <%= name %> = <%= camelize name %>Factory.post hash = {content: 'my content'} patch "/<%= pluralize name %>/#{<%= name %>._id}", to_json(hash) assert_equal 200, last_response.status end def test_delete_<%= name %>_by_id <%= name %> = <%= camelize name %>Factory.post delete "/<%= pluralize name %>/#{<%= name %>._id}" assert_equal 204, last_response.status end end
Version data entries
8 entries across 8 versions & 1 rubygems