blob: 81621b8ce3e5039967f0ea354c4f5f8484b43bdb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
require File.dirname(__FILE__) + '/../test_helper'
class PermalinkTest < Test::Unit::TestCase
fixtures :permalinks, :issues
def setup
User.current_user = User.create( { :login => 'quire', :email => 'quire@example.com', :password => 'quire', :password_confirmation => 'quire' } )
end
def test_should_create_permalink_with_issue
assert_difference 'Permalink.count' do
issue = create_issue
assert !issue.new_record?, "#{issue.errors.full_messages.to_sentence}"
end
end
def test_should_create_permalink_from_issue_title_change
issue = create_issue
assert_difference 'Permalink.count' do
issue.title = "new title"
issue.save!
assert !issue.new_record?, "#{issue.errors.full_messages.to_sentence}"
end
end
protected
def create_issue(options = {})
Issue.create( { :title => "the title of my issue", :description => "the description of my issue" }.merge(options) )
end
end
|