updated to rails 3.2, fixed tests
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
Factory.define(:artist) do |f|
|
||||
f.name {rand(1_000_000).to_s}
|
||||
f.creator {|x| x.association(:user)}
|
||||
f.is_active true
|
||||
end
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
Factory.define(:comment) do |f|
|
||||
f.post {|x| x.association(:post)}
|
||||
f.body {Faker::Lorem.sentences.join(" ")}
|
||||
f.score 0
|
||||
end
|
||||
|
||||
@@ -2,5 +2,4 @@ Factory.define(:dmail) do |f|
|
||||
f.to {|x| x.association(:user)}
|
||||
f.title {Faker::Lorem.words.join(" ")}
|
||||
f.body {Faker::Lorem.sentences.join(" ")}
|
||||
f.is_read false
|
||||
end
|
||||
|
||||
@@ -78,7 +78,7 @@ class DmailsControllerTest < ActionController::TestCase
|
||||
|
||||
should "create two messages, one for the sender and one for the recipient" do
|
||||
assert_difference("Dmail.count", 2) do
|
||||
dmail_attribs = {:to_id => @user_2.id, :title => "abc", :body => "abc", :is_read => false}
|
||||
dmail_attribs = {:to_id => @user_2.id, :title => "abc", :body => "abc"}
|
||||
post :create, {:dmail => dmail_attribs}, {:user_id => @user.id}
|
||||
assert_redirected_to dmail_path(Dmail.last)
|
||||
end
|
||||
|
||||
@@ -117,12 +117,14 @@ class ArtistTest < ActiveSupport::TestCase
|
||||
|
||||
should "have an associated wiki" do
|
||||
user = Factory.create(:user)
|
||||
CurrentUser.user = user
|
||||
artist = Factory.create(:artist, :name => "max", :wiki_page_attributes => {:title => "xxx", :body => "this is max"})
|
||||
assert_not_nil(artist.wiki_page)
|
||||
assert_equal("this is max", artist.wiki_page.body)
|
||||
|
||||
artist.update_attributes(:wiki_page_attributes => {:id => artist.wiki_page.id, :body => "this is hoge mark ii", :creator_id => user.id})
|
||||
artist.update_attributes({:wiki_page_attributes => {:id => artist.wiki_page.id, :body => "this is hoge mark ii"}})
|
||||
assert_equal("this is hoge mark ii", artist.wiki_page(true).body)
|
||||
CurrentUser.user = nil
|
||||
end
|
||||
|
||||
should "revert to prior versions" do
|
||||
|
||||
Reference in New Issue
Block a user