Skip to content
Browse files

Remove implementation for updating tickets

* Redmine API doesn't support this behaviour through journals, just creation, as far as I research
  • Loading branch information...
1 parent 872e0c1 commit 4a2166d156fc25bc155e77ababab770f27f6dd67 @cored cored committed Jul 4, 2012
Showing with 12 additions and 11 deletions.
  1. +10 −9 lib/provider/comment.rb
  2. +2 −2 spec/comments_spec.rb
View
19 lib/provider/comment.rb
@@ -24,15 +24,7 @@ def initialize(ticket_id, *object)
end
def save
- issue = API.find(ticket_id)
- journal = issue.journals.find { |jou| jou.id.to_i == id.to_i }
- journal.notes = body
- issue.journals.inject([]) do |arr, jour|
- arr << jour unless jour.id == journal.id
- arr
- end
- issue.journals << journal
- issue.save
+ raise TaskMapper::Exception.new "Redmine API doesn't support comment updates"
end
def self.find_by_id(project_id, ticket_id, id)
@@ -63,5 +55,14 @@ def self.create_journal_for_issue(attributes)
journal
end
end
+
+ class Net::HTTP
+ def send(*args)
+ puts "request: #{args.inspect}"
+ resp = super
+ puts "response: #{resp.inspect}"
+ resp
+ end
+ end
end
end
View
4 spec/comments_spec.rb
@@ -79,8 +79,8 @@
context "when #save" do
let(:comment) { ticket.comment(comment_id) }
let(:changed_comment) { comment.body = 'change'; comment }
- subject { changed_comment.save }
- it { should be_true }
+ subject { lambda { changed_comment.save } }
+ it { should raise_error "Redmine API doesn't support comment updates" }
end
end
end

0 comments on commit 4a2166d

Please sign in to comment.
Something went wrong with that request. Please try again.