Sha256: 636da2aee52583d1b747ec82ade93733c1c08bf5e6188eef0181e0354c3e2576
Contents?: true
Size: 1.97 KB
Versions: 3
Compression:
Stored size: 1.97 KB
Contents
describe ChatWork::Client::TaskMethods do describe "#get_tasks", type: :api do subject do client.get_tasks( room_id: room_id, account_id: account_id, assigned_by_account_id: assigned_by_account_id, status: status, &block ) end let(:room_id) { 123 } let(:account_id) { 101 } let(:assigned_by_account_id) { 78 } let(:status) { "done" } before do stub_chatwork_request(:get, "/rooms/#{room_id}/tasks", "/rooms/{room_id}/tasks") end it_behaves_like :a_chatwork_api, :get, "/rooms/{room_id}/tasks" end describe "#create_task", type: :api do subject do client.create_task( room_id: room_id, body: body, to_ids: to_ids, limit: limit, &block ) end let(:room_id) { 123 } let(:body) { "Buy milk" } let(:to_ids) { "1,3,6" } let(:limit) { "1385996399" } before do stub_chatwork_request(:post, "/rooms/#{room_id}/tasks", "/rooms/{room_id}/tasks") end context "when to_ids and limit are String" do it_behaves_like :a_chatwork_api, :post, "/rooms/{room_id}/tasks" end context "when to_ids is Array" do let(:to_ids) { [1, 3, 6] } it_behaves_like :a_chatwork_api, :post, "/rooms/{room_id}/tasks" end context "when limit is Time" do let(:limit) { Time.at(1_385_996_399) } it_behaves_like :a_chatwork_api, :post, "/rooms/{room_id}/tasks" end end describe "#find_task", type: :api do subject do client.find_task( room_id: room_id, task_id: task_id, &block ) end let(:room_id) { 123 } let(:task_id) { 3 } before do stub_chatwork_request(:get, "/rooms/#{room_id}/tasks/#{task_id}", "/rooms/{room_id}/tasks/{task_id}") end it_behaves_like :a_chatwork_api, :get, "/rooms/{room_id}/tasks/{task_id}" end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
chatwork-0.10.0 | spec/lib/chatwork/client/task_methods_spec.rb |
chatwork-0.9.0 | spec/lib/chatwork/client/task_methods_spec.rb |
chatwork-0.8.0 | spec/lib/chatwork/client/task_methods_spec.rb |