customer_test.rb 907 B

1234567891011121314151617181920
  1. require 'test_helper'
  2. class CustomerTest < Test::Unit::TestCase
  3. test "search should get a customers collection" do
  4. fake "customers/search.json?query=Bob+country%3AUnited+States", :extension => false, :body => load_fixture('customers_search')
  5. results = ShopifyAPI::Customer.search(query: 'Bob country:United States')
  6. assert_equal 'Bob', results.first.first_name
  7. end
  8. test "account_activation_url should create an account activation url" do
  9. fake "customers/207119551", :body => load_fixture('customers')
  10. fake "customers/207119551/account_activation_url", :method => :post, :body => load_fixture('customers_account_activation_url')
  11. customer = ShopifyAPI::Customer.find(207119551)
  12. activation_url = "http://apple.myshopify.com/account/activate/207119551/86688abf23572680740b1c062fa37111-1458248616"
  13. assert_equal activation_url, customer.account_activation_url
  14. end
  15. end