Sha256: fe89a411d5c0d372df7157c28f2aa73397a5920b3145e46a2cb659d17dd46394

Contents?: true

Size: 638 Bytes

Versions: 6

Compression:

Stored size: 638 Bytes

Contents

require 'test_helper'

class PostTest < ActiveSupport::TestCase
  setup do
    @category = PostCategory.create(name: "general")
    @post = Post.create(title: "Once Upon a Time")
  end
  
  test "post#route_name" do 
    assert_equal 'by_category_posts_general_once_upon_a_time', @post.route_name
  end
  
  test "Post controller_action" do 
    assert_equal 'blog#show', Post.flowmor_posts_router_class.controller_action
  end

  test "post#path" do
    assert_equal '/by_category/posts/general/once-upon-a-time', @post.path
  end

  test "post#archive_path" do
    assert_equal '/archive/once-upon-a-time', @post.archive_path
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
flowmor_router-0.2.6 test/dummy/test/models/post_test.rb
flowmor_router-0.2.5 test/dummy/test/models/post_test.rb
flowmor_router-0.2.4 test/dummy/test/models/post_test.rb
flowmor_router-0.2.3 test/dummy/test/models/post_test.rb
flowmor_router-0.2.2 test/dummy/test/models/post_test.rb
flowmor_router-0.2.1 test/dummy/test/models/post_test.rb