Mercurial > hg > soundsoftware-site
diff test/integration/issues_api_test.rb @ 23:ca82a3468d27 cannam
* Merge SVN update from default
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Fri, 24 Sep 2010 14:17:42 +0100 |
parents | 40f7cfd4df19 |
children |
line wrap: on
line diff
--- a/test/integration/issues_api_test.rb Thu Sep 23 16:19:06 2010 +0100 +++ b/test/integration/issues_api_test.rb Fri Sep 24 14:17:42 2010 +0100 @@ -198,7 +198,7 @@ setup do @issue_count = Issue.count @journal_count = Journal.count - @attributes = {:subject => 'API update'} + @attributes = {:subject => 'API update', :notes => 'A new note'} put '/issues/1.xml', {:issue => @attributes}, :authorization => credentials('jsmith') end @@ -214,10 +214,15 @@ assert_equal Journal.count, @journal_count + 1 end + should "add the note to the journal" do + journal = Journal.last + assert_equal "A new note", journal.notes + end + should "update the issue" do issue = Issue.find(1) @attributes.each do |attribute, value| - assert_equal value, issue.send(attribute) + assert_equal value, issue.send(attribute) unless attribute == :notes end end @@ -252,7 +257,7 @@ setup do @issue_count = Issue.count @journal_count = Journal.count - @attributes = {:subject => 'API update'} + @attributes = {:subject => 'API update', :notes => 'A new note'} put '/issues/1.json', {:issue => @attributes}, :authorization => credentials('jsmith') end @@ -268,13 +273,18 @@ assert_equal Journal.count, @journal_count + 1 end + should "add the note to the journal" do + journal = Journal.last + assert_equal "A new note", journal.notes + end + should "update the issue" do issue = Issue.find(1) @attributes.each do |attribute, value| - assert_equal value, issue.send(attribute) + assert_equal value, issue.send(attribute) unless attribute == :notes end end - + end context "PUT /issues/1.json with failed update" do