From 1e384a84bc39f3646add70fff5e32ccfb3458dc2 Mon Sep 17 00:00:00 2001 From: HOSAKA-HIROKI Date: Sat, 20 May 2017 14:20:40 +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..50c3103 100644 --- a/webapi/config-webapi.ru +++ b/webapi/config-webapi.ru @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +# HELLO!! $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 cc45771868e6b66992a3659a5dcc3ae9e637ecb2 Mon Sep 17 00:00:00 2001 From: HOSAKA-HIROKI Date: Sat, 20 May 2017 17:13:21 +0900 Subject: [PATCH 2/5] Update comment_spec.rb --- 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..c3bd249 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 02c9368f6ff9c91226531f476a34921522fb879a Mon Sep 17 00:00:00 2001 From: HOSAKA-HIROKI Date: Tue, 30 May 2017 20:16:31 +0900 Subject: [PATCH 3/5] Update comment_spec.rb --- 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 c3bd249..2874315 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 b7bb8293bcc5f7b69e517a35f2d9b0c35230ce14 Mon Sep 17 00:00:00 2001 From: HOSAKA-HIROKI Date: Sat, 3 Jun 2017 14:28:13 +0900 Subject: [PATCH 4/5] Update webapi_integration_spec.rb --- .../spec/webapi_integration_spec.rb | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/spec_integration/spec/webapi_integration_spec.rb b/spec_integration/spec/webapi_integration_spec.rb index a100854..e0aa487 100644 --- a/spec_integration/spec/webapi_integration_spec.rb +++ b/spec_integration/spec/webapi_integration_spec.rb @@ -37,20 +37,20 @@ 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 + 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 From a365eaf7d4446f5201de3985505fe73030d474f4 Mon Sep 17 00:00:00 2001 From: HOSAKA-HIROKI Date: Sat, 3 Jun 2017 14:33:01 +0900 Subject: [PATCH 5/5] Update webapi_integration_spec.rb --- .../spec/webapi_integration_spec.rb | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/spec_integration/spec/webapi_integration_spec.rb b/spec_integration/spec/webapi_integration_spec.rb index e0aa487..a100854 100644 --- a/spec_integration/spec/webapi_integration_spec.rb +++ b/spec_integration/spec/webapi_integration_spec.rb @@ -37,20 +37,20 @@ 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 + # 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