mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-25 02:06:10 +01:00
25 lines
No EOL
545 B
Ruby
25 lines
No EOL
545 B
Ruby
RAILS_ENV = 'test'
|
|
require File.expand_path(File.join(File.dirname(__FILE__), '../../../../config/environment.rb'))
|
|
require 'action_controller/test_process'
|
|
require 'breakpoint'
|
|
|
|
class Post
|
|
attr_reader :id
|
|
def save; @id = 1 end
|
|
def new_record?; @id.nil? end
|
|
def name
|
|
@id.nil? ? 'new post' : "post ##{@id}"
|
|
end
|
|
class Nested < Post; end
|
|
end
|
|
|
|
class Test::Unit::TestCase
|
|
protected
|
|
def posts_url
|
|
'http://www.example.com/posts'
|
|
end
|
|
|
|
def post_url(post)
|
|
"http://www.example.com/posts/#{post.id}"
|
|
end
|
|
end |