chatspry 0.0.1.pre2 → 0.0.1.pre3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/chatspry/default.rb +2 -2
- data/lib/chatspry/version.rb +1 -1
- data/spec/cassettes/Chatspry_Client/_get/handles_query_params.json +1 -1
- data/spec/cassettes/Chatspry_Client/_head/handles_query_params.json +1 -1
- data/spec/cassettes/Chatspry_Client/authentication/when_token_authenticated/fetches_and_memorizes_identifier.json +1 -1
- data/spec/helper.rb +6 -4
- data/spec/support/environment_defaults.rb +4 -0
- data/spec/support/fixture_configuration.rb +10 -24
- data/spec/support/request_stubs.rb +1 -1
- metadata +1 -1
data/lib/chatspry/default.rb
CHANGED
@@ -4,8 +4,8 @@ module Chatspry
|
|
4
4
|
|
5
5
|
module Default
|
6
6
|
|
7
|
-
API_ENDPOINT = "http://api.chatspry.
|
8
|
-
WEB_ENDPOINT = "http://chatspry.
|
7
|
+
API_ENDPOINT = "http://api.chatspry.com".freeze
|
8
|
+
WEB_ENDPOINT = "http://chatspry.com".freeze
|
9
9
|
|
10
10
|
MEDIA_TYPE = "application/json".freeze
|
11
11
|
USER_AGENT = "Chatspry Ruby Gem #{ Chatspry::VERSION }".freeze
|
data/lib/chatspry/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"http_interactions":[{"request":{"method":"get","uri":"http://api.chatspry.dev:8080/?foo=bar","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/json"],"User-Agent":["Chatspry Ruby Gem 0.0.1.
|
1
|
+
{"http_interactions":[{"request":{"method":"get","uri":"http://api.chatspry.dev:8080/?foo=bar","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/json"],"User-Agent":["Chatspry Ruby Gem 0.0.1.pre2"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":404,"message":"Not Found"},"headers":{"Date":["Wed, 18 Jun 2014 19:45:11 GMT"],"Status":["404 Not Found"],"Connection":["close"],"X-Frame-Options":["SAMEORIGIN"],"X-Xss-Protection":["1; mode=block"],"X-Content-Type-Options":["nosniff"],"Content-Type":["text/plain"],"Cache-Control":["no-cache"],"X-Request-Id":["d306d0c0-e812-4ef5-8b8d-4577793b694c"],"X-Runtime":["0.009840"]},"body":{"encoding":"US-ASCII","base64_string":"IA==\n"},"http_version":null},"recorded_at":"Wed, 18 Jun 2014 19:45:11 GMT"}],"recorded_with":"VCR 2.9.2"}
|
@@ -1 +1 @@
|
|
1
|
-
{"http_interactions":[{"request":{"method":"head","uri":"http://api.chatspry.dev:8080/?foo=bar","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/json"],"User-Agent":["Chatspry Ruby Gem 0.0.1.
|
1
|
+
{"http_interactions":[{"request":{"method":"head","uri":"http://api.chatspry.dev:8080/?foo=bar","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/json"],"User-Agent":["Chatspry Ruby Gem 0.0.1.pre2"]}},"response":{"status":{"code":404,"message":"Not Found"},"headers":{"Date":["Wed, 18 Jun 2014 19:45:11 GMT"],"Status":["404 Not Found"],"Connection":["close"],"X-Frame-Options":["SAMEORIGIN"],"X-Xss-Protection":["1; mode=block"],"X-Content-Type-Options":["nosniff"],"Content-Type":["text/plain"],"Cache-Control":["no-cache"],"X-Request-Id":["d014269f-e902-405e-8d28-913f1cbfe36c"],"X-Runtime":["0.009593"]},"body":{"encoding":"US-ASCII","base64_string":""},"http_version":null},"recorded_at":"Wed, 18 Jun 2014 19:45:11 GMT"}],"recorded_with":"VCR 2.9.2"}
|
@@ -1 +1 @@
|
|
1
|
-
{"http_interactions":[{"request":{"method":"get","uri":"http://api.chatspry.dev:8080/v1/user","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/json"],"User-Agent":["Chatspry Ruby Gem 0.0.1.
|
1
|
+
{"http_interactions":[{"request":{"method":"get","uri":"http://api.chatspry.dev:8080/v1/user","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/json"],"User-Agent":["Chatspry Ruby Gem 0.0.1.pre2"],"Authorization":["Bearer <ACCESS_TOKEN>"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 18 Jun 2014 19:45:11 GMT"],"Status":["200 OK"],"Connection":["close"],"X-Frame-Options":["SAMEORIGIN"],"X-Xss-Protection":["1; mode=block"],"X-Content-Type-Options":["nosniff"],"Access-Control-Allow-Credentials":["true"],"Access-Control-Allow-Methods":["GET,POST,PUT,DELETE,PATCH,OPTIONS"],"Access-Control-Allow-Headers":["*"],"Access-Control-Max-Age":["1728000"],"Content-Type":["application/json; charset=utf-8"],"Etag":["\"0a2327f04d9202b40e890296b3055c0f\""],"Cache-Control":["max-age=0, private, must-revalidate"],"X-Request-Id":["f4b0be17-33c0-4814-9a3e-a67d6f3d7509"],"X-Runtime":["0.014420"]},"body":{"encoding":"US-ASCII","base64_string":"eyJ1c2VyIjp7ImlkIjoiN2EyYjI0MTktYzU5NC00MzU5LWFhMzUtMTVhNWJk\nNjMxOGRjIiwiaGFuZGxlIjoiPENIQVRTUFJZX0lERU5USUZJRVI+IiwibmFt\nZSI6IlBoaWxpcCBWaWVpcmEiLCJ1cGRhdGVkX2F0IjoxNDAzMDM2MjQ5LCJj\ncmVhdGVkX2F0IjoxNDAzMDM2MjQ5fX0=\n"},"http_version":null},"recorded_at":"Wed, 18 Jun 2014 19:45:11 GMT"}],"recorded_with":"VCR 2.9.2"}
|
data/spec/helper.rb
CHANGED
@@ -3,6 +3,12 @@ require "chatspry"
|
|
3
3
|
require "rspec"
|
4
4
|
require "webmock/rspec"
|
5
5
|
|
6
|
+
require "support/fixture_configuration"
|
7
|
+
require "support/environment_defaults"
|
8
|
+
require "support/request_stubs"
|
9
|
+
|
10
|
+
ENV["CHATSPRY_API_ENDPOINT"] = test_chatspry_api_endpoint
|
11
|
+
|
6
12
|
RSpec.configure do |config|
|
7
13
|
|
8
14
|
config.filter_run :focus
|
@@ -25,10 +31,6 @@ RSpec.configure do |config|
|
|
25
31
|
|
26
32
|
end
|
27
33
|
|
28
|
-
require "support/fixture_configuration"
|
29
|
-
require "support/environment_defaults"
|
30
|
-
require "support/request_stubs"
|
31
|
-
|
32
34
|
def oauth_client
|
33
35
|
Chatspry::Client.new(:access_token => test_chatspry_token)
|
34
36
|
end
|
@@ -23,34 +23,20 @@ VCR.configure do |c|
|
|
23
23
|
test_chatspry_client_secret
|
24
24
|
end
|
25
25
|
|
26
|
-
|
26
|
+
c.before_http_request(:real?) do |request|
|
27
27
|
|
28
|
-
|
29
|
-
# next unless request.uri.include? test_github_repository
|
28
|
+
next if request.headers["X-Vcr-Test-Setup"]
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
request_options = {
|
31
|
+
headers: { "X-Vcr-Test-Setup" => "true" },
|
32
|
+
auto_init: true
|
33
|
+
}
|
35
34
|
|
36
|
-
|
37
|
-
# if !oauth_client.repository?(test_repo, options)
|
38
|
-
# Octokit.octokit_warn "NOTICE: Creating #{test_repo} test repository."
|
39
|
-
# oauth_client.create_repository(test_github_repository, options)
|
40
|
-
# end
|
41
|
-
|
42
|
-
# test_org_repo = "#{test_github_org}/#{test_github_repository}"
|
43
|
-
# if !oauth_client.repository?(test_org_repo, options)
|
44
|
-
# Octokit.octokit_warn "NOTICE: Creating #{test_org_repo} test repository."
|
45
|
-
# options[:organization] = test_github_org
|
46
|
-
# oauth_client.create_repository(test_github_repository, options)
|
47
|
-
# end
|
48
|
-
|
49
|
-
# end
|
35
|
+
end
|
50
36
|
|
51
|
-
|
52
|
-
|
53
|
-
|
37
|
+
c.ignore_request do |request|
|
38
|
+
!!request.headers["X-Vcr-Test-Setup"]
|
39
|
+
end
|
54
40
|
|
55
41
|
c.default_cassette_options = {
|
56
42
|
serialize_with: :json,
|