helix 0.0.1.9.pre → 0.0.2.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/helix/config.rb +1 -1
- data/spec/config_spec.rb +6 -1
- metadata +1 -1
data/lib/helix/config.rb
CHANGED
@@ -76,7 +76,7 @@ module Helix
|
|
76
76
|
def get_base_url(opts)
|
77
77
|
creds = credentials
|
78
78
|
base_url = creds[:site]
|
79
|
-
return base_url if opts[:guid]
|
79
|
+
return base_url if opts[:guid] || opts[:action] == :create_many
|
80
80
|
reseller, company, library = SCOPES.map { |scope| creds[scope] }
|
81
81
|
base_url += "/resellers/#{reseller}" if reseller
|
82
82
|
if company
|
data/spec/config_spec.rb
CHANGED
@@ -105,7 +105,7 @@ describe Helix::Config do
|
|
105
105
|
|
106
106
|
def build_test_url(site, sub_url, guid, action, media_type, format)
|
107
107
|
expected_url = site
|
108
|
-
expected_url += sub_url unless guid
|
108
|
+
expected_url += sub_url unless guid || action == :create_many
|
109
109
|
expected_url += "/#{media_type}"
|
110
110
|
expected_url += "/the_guid" if guid
|
111
111
|
expected_url += "/#{action}" if action
|
@@ -158,6 +158,11 @@ describe Helix::Config do
|
|
158
158
|
end
|
159
159
|
end
|
160
160
|
end
|
161
|
+
context "when given 'create_many' as an action" do
|
162
|
+
opts = { action: :create_many }
|
163
|
+
subject { obj.send(meth, opts) }
|
164
|
+
it_behaves_like "reads scope from credentials for build_url", :videos, :json, opts
|
165
|
+
end
|
161
166
|
context "when given NO opts" do
|
162
167
|
subject { obj.send(meth) }
|
163
168
|
it_behaves_like "reads scope from credentials for build_url", :videos, :json
|