Sha256: feb98a81cfca8c38577bfe3ab88433921a6be7d58453f99e237c3328a9347310

Contents?: true

Size: 567 Bytes

Versions: 14

Compression:

Stored size: 567 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class PostsControllerTest < ActionController::TestCase
  def setup
    @post = Post.find 1
  end
  
  should_be_restful do |resource|
    resource.formats = [:html]

    resource.actions = :all
  end
  
  context "on post to :create" do
    setup do
      post :create, :post => {}
    end

    should "name the post 'a great post'" do
      assert_equal 'a great post', assigns(:post).title
    end
    
    should "give the post a body of '...'" do
      assert_equal '...', assigns(:post).body
    end
  end
end

Version data entries

14 entries across 14 versions & 5 rubygems

Version Path
viva-resource_controller-0.6.5.1 test/test/functional/posts_controller_test.rb
viva-resource_controller-0.6.5.2 test/test/functional/posts_controller_test.rb
viva-resource_controller-0.6.5 test/test/functional/posts_controller_test.rb
matid-resource_controller-0.7.2 test/test/functional/posts_controller_test.rb
matid-resource_controller-0.7.1 test/test/functional/posts_controller_test.rb
matid-resource_controller-0.7.0 test/test/functional/posts_controller_test.rb
resource_controller_views-0.6.6.views2 test/test/functional/posts_controller_test.rb
matid-resource_controller-0.6.7 test/test/functional/posts_controller_test.rb
resource_controller_views-0.6.6 test/test/functional/posts_controller_test.rb
resource_controller-0.6.6 test/test/functional/posts_controller_test.rb
Pr0d1r2-resource_controller-0.6.6 test/test/functional/posts_controller_test.rb
matid-resource_controller-0.6.6 test/test/functional/posts_controller_test.rb
viva-resource_controller-0.6.5.3 test/test/functional/posts_controller_test.rb
matid-resource_controller-0.6.5 test/test/functional/posts_controller_test.rb