wei-backend 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 284f669a73962a222fddf28616a039729db7d7e3
4
- data.tar.gz: f6d887248c233c2722562302bbfafb75691e8ebc
3
+ metadata.gz: 2e71022dc9103d79911126ec2b08c09624105c1c
4
+ data.tar.gz: 2170b1c6de741b5e2eba156902b118a05067d014
5
5
  SHA512:
6
- metadata.gz: c8720c415ee7e9db7f648fbb5c2db427311226655fc55078f70af65326c860f9c43f2837a78c9f734f2393d31a94944f8a7e3c38b5cce9b31c8eced3c02f285c
7
- data.tar.gz: 291580ee8bcc4ac7211fbf6cfaadbd513f040da7197c840ab3ef8685167c03a72982f46a6301dc7217dddf615bd490f7b5753c95400fe91fbb2dfd1a24a2bebe
6
+ metadata.gz: 00c4f48060e0cc7238ac6d27c6d6bc736b857c515c9f53b0793cdf1d24b9a8b06e99b042cea348fdbc9cf38ffe19d23d8cda82c8601d158909160034089c0ec5
7
+ data.tar.gz: 5c72ee53f6bc9b12f1b49583e07e6d8f564528f06735f06a08404ebcc1fd1e24c1edb96e731165f0a65d056171a47a68734c962381f9f824eea70c83749a9ff5
@@ -16,11 +16,11 @@ token_proc = proc {
16
16
  WeiBackend::MessageDispatcher.token
17
17
  }
18
18
 
19
- get '/', :access_token => token_proc do
19
+ get '/weixin', :access_token => token_proc do
20
20
  params[:echostr]
21
21
  end
22
22
 
23
- post '/', :access_token => token_proc do
23
+ post '/weixin', :access_token => token_proc do
24
24
  request.body.rewind
25
25
  weixin_params = WeiBackend::Utils.parse_params request.body.read
26
26
  handler = WeiBackend::MessageDispatcher.new
@@ -1,3 +1,3 @@
1
1
  module WeiBackend
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -3,7 +3,7 @@ describe 'app' do
3
3
  include Rack::Test::Methods
4
4
 
5
5
  it 'should echo string when request with echostr parameter' do
6
- get '/?echostr=test'
6
+ get '/weixin?echostr=test'
7
7
  last_response.body.should include 'test'
8
8
  end
9
9
 
@@ -12,7 +12,7 @@ describe 'app' do
12
12
  'hello world'
13
13
  end
14
14
 
15
- post '/', TEXT_MESSAGE_REQUEST, 'CONTENT_TYPE' => 'text/xml'
15
+ post '/weixin', TEXT_MESSAGE_REQUEST, 'CONTENT_TYPE' => 'text/xml'
16
16
  last_response.body.should include '<ToUserName><![CDATA[fromUser]]></ToUserName>'
17
17
  last_response.body.should include '<Content><![CDATA[hello world]]></Content>'
18
18
  end
@@ -22,7 +22,7 @@ describe 'app' do
22
22
  {:title => 'title', :description => 'desc', :picture_url => 'pic url', :url => 'url'}
23
23
  end
24
24
 
25
- post '/', TEXT_MESSAGE_REQUEST, 'CONTENT_TYPE' => 'text/xml'
25
+ post '/weixin', TEXT_MESSAGE_REQUEST, 'CONTENT_TYPE' => 'text/xml'
26
26
  last_response.body.should include '<ToUserName><![CDATA[fromUser]]></ToUserName>'
27
27
  last_response.body.should include '<Title><![CDATA[title]]></Title>'
28
28
  end
@@ -43,7 +43,7 @@ describe 'app' do
43
43
  }]
44
44
  end
45
45
 
46
- post '/', TEXT_MESSAGE_REQUEST, 'CONTENT_TYPE' => 'text/xml'
46
+ post '/weixin', TEXT_MESSAGE_REQUEST, 'CONTENT_TYPE' => 'text/xml'
47
47
  last_response.body.should include '<ToUserName><![CDATA[fromUser]]></ToUserName>'
48
48
  last_response.body.should include '<Title><![CDATA[title]]></Title>'
49
49
  last_response.body.should include '<Title><![CDATA[title1]]></Title>'
@@ -54,7 +54,7 @@ describe 'app' do
54
54
  "location event: #{params[:Latitude]}"
55
55
  end
56
56
 
57
- post '/', LOCATION_EVENT_REQUEST, 'CONTENT_TYPE' => 'text/xml'
57
+ post '/weixin', LOCATION_EVENT_REQUEST, 'CONTENT_TYPE' => 'text/xml'
58
58
  last_response.body.should include '<ToUserName><![CDATA[fromUser]]></ToUserName>'
59
59
  last_response.body.should include '<Content><![CDATA[location event: 23.137466]]></Content>'
60
60
  end
@@ -64,7 +64,7 @@ describe 'app' do
64
64
  'Thank you for subscribe!'
65
65
  end
66
66
 
67
- post '/', SUBSCRIBE_EVENT_REQUEST, 'CONTENT_TYPE' => 'text/xml'
67
+ post '/weixin', SUBSCRIBE_EVENT_REQUEST, 'CONTENT_TYPE' => 'text/xml'
68
68
  last_response.body.should include '<ToUserName><![CDATA[fromUser]]></ToUserName>'
69
69
  last_response.body.should include '<Content><![CDATA[Thank you for subscribe!]]></Content>'
70
70
  end
@@ -76,7 +76,7 @@ describe 'app' do
76
76
 
77
77
  WeiBackend::MessageDispatcher.token 'combustest'
78
78
 
79
- post '/?signature=0d144fa22f4119dbb2f6fe9710f3b732fb45092b&timestamp=1388674716&nonce=1388564676', SUBSCRIBE_EVENT_REQUEST, 'CONTENT_TYPE' => 'text/xml', 'token' => 'token'
79
+ post '/weixin?signature=0d144fa22f4119dbb2f6fe9710f3b732fb45092b&timestamp=1388674716&nonce=1388564676', SUBSCRIBE_EVENT_REQUEST, 'CONTENT_TYPE' => 'text/xml', 'token' => 'token'
80
80
  last_response.body.should include '<ToUserName><![CDATA[fromUser]]></ToUserName>'
81
81
  last_response.body.should include '<Content><![CDATA[Thank you for subscribe!]]></Content>'
82
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wei-backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wang Chao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-22 00:00:00.000000000 Z
11
+ date: 2014-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra