Sha256: 0c370c427f504406028a104c2342842e7794a641a947f8e81b94ebe2baddd8b9

Contents?: true

Size: 725 Bytes

Versions: 16

Compression:

Stored size: 725 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

module Spree
  describe Api::ConfigController, type: :request do
    let(:user) { create(:user) }

    let!(:default_country) { create :country, iso: "US" }

    it "returns Spree::Money settings" do
      get '/api/config/money', headers: user.create_new_auth_token
      expect(response).to be_successful
      expect(json_response["symbol"]).to eq("$")
    end

    it "returns some configuration settings" do
      get '/api/config', headers: user.create_new_auth_token
      expect(response).to be_successful
      expect(json_response["default_country_iso"]).to eq("US")
      expect(json_response["default_country_id"]).to eq(default_country.id)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
solidus_api_devise_token_auth-2.8.0.alpha.14 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.13 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.12 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.11 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.10 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.9 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.8 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.7 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.6 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.5 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.4 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.3 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.2 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.1 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha.0 spec/requests/spree/api/config_controller_spec.rb
solidus_api_devise_token_auth-2.8.0.alpha spec/requests/spree/api/config_controller_spec.rb