-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to use test-unit framework for unit tests, update search objec…
…t model and add unit tests
- Loading branch information
Showing
14 changed files
with
1,212 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug Local File", | ||
"type": "Ruby", | ||
"request": "launch", | ||
"cwd": "${workspaceRoot}", | ||
"program": "${file}", | ||
"showDebuggerOutput": true | ||
}, | ||
{ | ||
"name": "Listen for rdebug-ide", | ||
"type": "Ruby", | ||
"request": "attach", | ||
"cwd": "${workspaceRoot}", | ||
"remoteHost": "127.0.0.1", | ||
"remotePort": "1234", | ||
"remoteWorkspaceRoot": "${workspaceRoot}" | ||
}, | ||
{ | ||
"name": "Rails server", | ||
"type": "Ruby", | ||
"request": "launch", | ||
"cwd": "${workspaceRoot}", | ||
"program": "${workspaceRoot}/bin/rails", | ||
"args": [ | ||
"server" | ||
] | ||
}, | ||
{ | ||
"name": "RSpec - all", | ||
"type": "Ruby", | ||
"request": "launch", | ||
"cwd": "${workspaceRoot}", | ||
"program": "${workspaceRoot}/bin/rspec", | ||
"args": [ | ||
"-I", | ||
"${workspaceRoot}" | ||
] | ||
}, | ||
{ | ||
"name": "RSpec - active spec file only", | ||
"type": "Ruby", | ||
"request": "launch", | ||
"cwd": "${workspaceRoot}", | ||
"program": "${workspaceRoot}/bin/rspec", | ||
"args": [ | ||
"-I", | ||
"${workspaceRoot}", | ||
"${file}" | ||
] | ||
}, | ||
{ | ||
"name": "Cucumber", | ||
"type": "Ruby", | ||
"request": "launch", | ||
"cwd": "${workspaceRoot}", | ||
"program": "${workspaceRoot}/bin/cucumber" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require_relative "RequestBase" | ||
|
||
class SearchImagesCreative < RequestBase | ||
|
||
CONNECT_ROUTE = "/v3/search/images/creative" # mashery endpoint | ||
@@search_route = CONNECT_ROUTE | ||
QUERY_PARAMS_NAMES = ["age_of_people","artists","collection_codes","collections_filter_type","color","compositions","embed_content_only","ethnicity","exclude_nudity","fields","file_types", | ||
"graphical_styles","keyword_ids","license_models","minimum_size","number_of_people","orientations","page","page_size","phrase","prestige_content_only","product_types", | ||
"sort_order"] | ||
|
||
QUERY_PARAMS_NAMES.each do |key| | ||
define_method :"with_#{key}" do |value = true| | ||
if value.is_a?(Array) | ||
value = value.join(",") | ||
if !key.include? "id" | ||
value.downcase! | ||
end | ||
build_query_params(key, value) | ||
else | ||
if (!key.include? "id") && (value.is_a?(String)) | ||
value.downcase! | ||
end | ||
build_query_params(key, value) | ||
end | ||
return self | ||
end | ||
end | ||
|
||
def execute | ||
return @http_helper.get(@@search_route, @query_params) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require_relative "RequestBase" | ||
|
||
class SearchImagesEditorial < RequestBase | ||
|
||
CONNECT_ROUTE = "/v3/search/images/editorial" # mashery endpoint | ||
@@search_route = CONNECT_ROUTE | ||
QUERY_PARAMS_NAMES = ["age_of_people","artists","collection_codes","collections_filter_type","compositions","editorial_segments","embed_content_only","end_date","entity_uris","ethnicity", | ||
"event_ids","exclude_nudity","fields","file_types","graphical_styles","keyword_ids","minimum_quality_rank","minimum_size","number_of_people","orientations","page","page_size","phrase", | ||
"product_types","sort_order","specific_people","start_date"] | ||
|
||
QUERY_PARAMS_NAMES.each do |key| | ||
define_method :"with_#{key}" do |value = true| | ||
if value.is_a?(Array) | ||
value = value.join(",") | ||
if !key.include? "id" | ||
value.downcase! | ||
end | ||
build_query_params(key, value) | ||
else | ||
if (!key.include? "id") && (value.is_a?(String)) | ||
value.downcase! | ||
end | ||
build_query_params(key, value) | ||
end | ||
return self | ||
end | ||
end | ||
|
||
def execute | ||
return @http_helper.get(@@search_route, @query_params) | ||
end | ||
|
||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'ConnectSDK', '~> 1.0.1.Beta' | ||
gem 'json', '~> 1.8.1' | ||
gem 'cucumber', '~> 1.3.17' | ||
gem 'rake', '~> 10.4.2' | ||
gem 'ConnectSDK' | ||
gem 'rake' | ||
gem 'json' | ||
gem 'cucumber' | ||
gem 'gherkin' | ||
gem 'test-unit' | ||
gem 'mockserver-client' | ||
gem 'webmock' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.