Sha256: a7909541e02e3006ad1a44d0237ac59d3b6a0c4c53766648a84da1107b6ccf66
Contents?: true
Size: 725 Bytes
Versions: 8
Compression:
Stored size: 725 Bytes
Contents
require "test_helper" class Admin::PostsControllerTest < ActionController::TestCase context "Overwrite action_after_save" do setup do Typus::Resources.expects(:action_after_save).returns("index") end should "create an item and redirect to index" do assert_difference 'Post.count' do post :create, { :post => { :title => 'This is another title', :body => 'Body' } } assert_response :redirect assert_redirected_to :action => 'index' end end should "update an item and redirect to index" do post :update, { :id => Factory(:post).id, :title => 'Updated' } assert_response :redirect assert_redirected_to :action => 'index' end end end
Version data entries
8 entries across 8 versions & 1 rubygems