Skip to content

Commit

Permalink
Board repository posts to the boards collection
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-biddington authored and jeremytregunna committed Jan 31, 2012
1 parent 07576f7 commit 67f532b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/trello/board.rb
Expand Up @@ -9,7 +9,7 @@ def find(id)
super(:boards, id)
end

def create(attributes = {})
def create(attributes)
Client.post "/boards/", attributes
end
end
Expand Down
7 changes: 7 additions & 0 deletions spec/board_spec.rb
Expand Up @@ -86,11 +86,18 @@ module Trello
describe "Repository" do
it "creates a new board with whatever attributes are supplied " do
expected_attributes = { :name => "Any new board name", :description => "Any new board desription" }

Client.should_receive(:post).with(anything, expected_attributes)

Board.create expected_attributes
end

it "posts to the boards collection" do
Client.should_receive(:post).with("/boards/", anything)

Board.create :xxx => ""
end

it "at least name is required"
end
end

0 comments on commit 67f532b

Please sign in to comment.