Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris Saunders
committed
Dec 9, 2014
1 parent
99ef4da
commit b6afcd9
Showing
4 changed files
with
36 additions
and
2 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,7 @@ | ||
module ShopifyAPI | ||
class Policy < Base | ||
def self.all | ||
find(:all) | ||
end | ||
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,8 @@ | ||
{ | ||
"policies": [ | ||
{ | ||
"title": "Privacy Policy", | ||
"body": "Your privacy is important to us" | ||
} | ||
] | ||
} |
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,19 @@ | ||
require 'test_helper' | ||
|
||
class PolicyTest < Test::Unit::TestCase | ||
def setup | ||
super | ||
fake 'shop' | ||
end | ||
|
||
def test_getting_the_list_of_policies | ||
fake 'policies' | ||
|
||
policies = ShopifyAPI::Policy.all | ||
assert_equal 1, policies.length | ||
|
||
policy = policies.first | ||
assert_equal 'Privacy Policy', policy.title | ||
assert_equal 'Your privacy is important to us', policy.body | ||
end | ||
end |