This repository has been archived by the owner on May 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add helper module and methods for test readability
- Loading branch information
Showing
5 changed files
with
51 additions
and
20 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
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 |
---|---|---|
|
@@ -50,3 +50,4 @@ def fixture_file(file_name) | |
|
||
include AuthenticationHelper | ||
include NacreConfigHelper | ||
include UrlHelper |
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,37 @@ | ||
require 'spec_helper' | ||
|
||
module UrlHelper | ||
def base_url | ||
'https://ws-eu1.brightpearl.com/%s/%s' % | ||
[Nacre.configuration.api_version, Nacre.configuration.user_id] | ||
end | ||
|
||
def auth_url | ||
'https://ws-eu1.brightpearl.com/%s/authorise' % | ||
[Nacre.configuration.user_id] | ||
end | ||
|
||
def resource_service_url(resource) | ||
"#{base_url}/#{resource}-service/#{resource}" | ||
end | ||
|
||
def order_service_url | ||
resource_service_url('order') | ||
end | ||
|
||
def product_service_url | ||
resource_service_url('product') | ||
end | ||
|
||
def resource_search_url(resource) | ||
"#{base_url}/#{resource}-service/#{resource}-search" | ||
end | ||
|
||
def order_search_url | ||
resource_search_url('order') | ||
end | ||
|
||
def product_search_url | ||
resource_search_url('product') | ||
end | ||
end |