From 393678468d48559af0c45549f1a13b2b1a27b487 Mon Sep 17 00:00:00 2001 From: HaradaTomohiro Date: Sat, 20 May 2017 13:28:15 +0900 Subject: [PATCH 1/5] Add Comment --- webapi/config-webapi.ru | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapi/config-webapi.ru b/webapi/config-webapi.ru index 43e3689..96c044f 100644 --- a/webapi/config-webapi.ru +++ b/webapi/config-webapi.ru @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +# Hello World!! $LOAD_PATH.unshift File.expand_path('../lib', __FILE__) @@ -32,4 +33,4 @@ map '/api' do map '/0.0.1' do run Webapi::Endpoints::V001::Webapi.new end -end \ No newline at end of file +end From 552f7c7d20937acc9f37c0f208baeb0cf4e51a6b Mon Sep 17 00:00:00 2001 From: HaradaTomohiro Date: Sat, 20 May 2017 13:31:32 +0900 Subject: [PATCH 2/5] UpdateComment --- webapi/config-webapi.ru | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapi/config-webapi.ru b/webapi/config-webapi.ru index 96c044f..859a144 100644 --- a/webapi/config-webapi.ru +++ b/webapi/config-webapi.ru @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Hello World!! +# Hello World! $LOAD_PATH.unshift File.expand_path('../lib', __FILE__) From 72177ddbc875ce4f424982c61be8c006764690d7 Mon Sep 17 00:00:00 2001 From: HaradaTomohiro Date: Sat, 20 May 2017 17:40:00 +0900 Subject: [PATCH 3/5] comment delete --- webapi/spec/comment_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webapi/spec/comment_spec.rb b/webapi/spec/comment_spec.rb index 98107c9..a9a0f68 100644 --- a/webapi/spec/comment_spec.rb +++ b/webapi/spec/comment_spec.rb @@ -9,8 +9,8 @@ expect(comment).to eq(Webapi::Models::Comment[comment.id]) end - # it "validation display_name size must be 10 or less." do - # expect { Webapi::Models::Comment.create(:display_name => "spec test 2", - # :comment => "test comment.") }.to raise_error(Sequel::ValidationFailed) - # end + it "validation display_name size must be 10 or less." do + expect { Webapi::Models::Comment.create(:display_name => "spec test 2", + :comment => "test comment.") }.to raise_error(Sequel::ValidationFailed) + end end From 1d06feb203b81b43dd349d7ca4936a4615df0003 Mon Sep 17 00:00:00 2001 From: HaradaTomohiro Date: Sat, 20 May 2017 17:40:30 +0900 Subject: [PATCH 4/5] comment add --- webapi/spec/comment_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webapi/spec/comment_spec.rb b/webapi/spec/comment_spec.rb index a9a0f68..98107c9 100644 --- a/webapi/spec/comment_spec.rb +++ b/webapi/spec/comment_spec.rb @@ -9,8 +9,8 @@ expect(comment).to eq(Webapi::Models::Comment[comment.id]) end - it "validation display_name size must be 10 or less." do - expect { Webapi::Models::Comment.create(:display_name => "spec test 2", - :comment => "test comment.") }.to raise_error(Sequel::ValidationFailed) - end + # it "validation display_name size must be 10 or less." do + # expect { Webapi::Models::Comment.create(:display_name => "spec test 2", + # :comment => "test comment.") }.to raise_error(Sequel::ValidationFailed) + # end end From f0912c3b4b41b033345464ddcbf691b470b9c46b Mon Sep 17 00:00:00 2001 From: HaradaTomohiro Date: Sat, 3 Jun 2017 13:28:43 +0900 Subject: [PATCH 5/5] delete comment --- .../spec/webapi_integration_spec.rb | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/spec_integration/spec/webapi_integration_spec.rb b/spec_integration/spec/webapi_integration_spec.rb index a100854..b0f1879 100644 --- a/spec_integration/spec/webapi_integration_spec.rb +++ b/spec_integration/spec/webapi_integration_spec.rb @@ -37,20 +37,21 @@ end end - # describe 'update' do - # before do - # comment_params[:comment] = "webapi sample message 2" - # end - # it 'update api not allowed' do - # res = WebAPIClient::Comment.update(comment["id"], comment_params) - # expect(res["code"]).to eq 405 - # end - # end - - # describe 'delete' do - # it 'delete api not allowed' do - # res = WebAPIClient::Comment.delete(comment["id"]) - # expect(res["code"]).to eq 405 - # end - # end +#delete comment + describe 'update' do + before do + comment_params[:comment] = "webapi sample message 2" + end + it 'update api not allowed' do + res = WebAPIClient::Comment.update(comment["id"], comment_params) + expect(res["code"]).to eq 405 + end + end + + describe 'delete' do + it 'delete api not allowed' do + res = WebAPIClient::Comment.delete(comment["id"]) + expect(res["code"]).to eq 405 + end + end end