-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from voucherifyio/v5.0.1
V5.0.1
- Loading branch information
Showing
14 changed files
with
841 additions
and
13 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
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 '../lib/config.rb' | ||
require_relative '../lib/voucherify_data.rb' | ||
require 'VoucherifySdk' | ||
|
||
RSpec.describe 'Validation Rules API', :order => :defined do | ||
before(:each) do | ||
@validation_rules_api_instance = Config.validation_rules_api_instance() | ||
@voucherify_data = VoucherifyData.instance() | ||
end | ||
|
||
it 'create validation rule', :order => :first do | ||
voucher = @voucherify_data.get_voucher() | ||
validation_rule = @voucherify_data.get_validation_rule() | ||
|
||
validationRulesAssignmentsCreateRequestBody = VoucherifySdk::ValidationRulesAssignmentsCreateRequestBody.new({ | ||
related_object_type: "voucher", | ||
related_object_id: voucher.code | ||
}) | ||
|
||
created_validation_rule_assignment = @validation_rules_api_instance.create_validation_rule_assignment(validation_rule.id, { | ||
validation_rules_assignments_create_request_body: validationRulesAssignmentsCreateRequestBody | ||
}) | ||
|
||
expect(created_validation_rule_assignment).not_to be_nil | ||
expect(created_validation_rule_assignment.id).not_to be_nil | ||
expect(created_validation_rule_assignment.created_at).not_to be_nil | ||
expect(created_validation_rule_assignment.rule_id).to eq(validation_rule.id) | ||
expect(created_validation_rule_assignment.related_object_id).to eq(voucher.id) | ||
expect(created_validation_rule_assignment.related_object_type).to eq("voucher") | ||
expect(created_validation_rule_assignment.object).to eq("validation_rules_assignment") | ||
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
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,9 @@ | ||
# VoucherifySdk::ValidationRulesAssignmentsCreateRequestBody | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| ---- | ---- | ----------- | ----- | | ||
| **related_object_type** | **String** | Defines the related object. i.e. `voucher`. | [optional][default to 'voucher'] | | ||
| **related_object_id** | **String** | Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher. | [optional] | | ||
|
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,13 @@ | ||
# VoucherifySdk::ValidationRulesAssignmentsCreateResponseBody | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| ---- | ---- | ----------- | ----- | | ||
| **id** | **String** | Validation rule assignment ID. | | | ||
| **rule_id** | **String** | Validation rule ID. | | | ||
| **related_object_id** | **String** | The resource ID to which the validation rule was assigned. | | | ||
| **related_object_type** | **String** | The type of resource to which the validation rule was assigned. | | | ||
| **created_at** | **Time** | Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format. | | | ||
| **object** | **String** | The type of object represented by the ID. | [default to 'validation_rules_assignment'] | | ||
|
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
Oops, something went wrong.