spec/configuration_spec.rb in affirm-ruby-1.0.1 vs spec/configuration_spec.rb in affirm-ruby-1.0.2
- old
+ new
@@ -52,21 +52,39 @@
expect(Affirm.configuration.endpoint).to eq("https://api.affirm.com")
end
end
context "when environment is set to sandbox" do
- before do
- Affirm.configure do |config|
- config.environment = :sandbox
+ context "via string" do
+ before do
+ Affirm.configure do |config|
+ config.environment = 'sandbox'
+ end
end
- end
- it "sets environment to sandbox" do
- expect(Affirm.configuration.environment).to eq(:sandbox)
+ it "sets environment to sandbox" do
+ expect(Affirm.configuration.environment).to eq(:sandbox)
+ end
+
+ it "sets endpoint to sandbox" do
+ expect(Affirm.configuration.endpoint).to eq("https://sandbox.affirm.com")
+ end
end
- it "sets endpoint to sandbox" do
- expect(Affirm.configuration.endpoint).to eq("https://sandbox.affirm.com")
+ context "via symbol" do
+ before do
+ Affirm.configure do |config|
+ config.environment = :sandbox
+ end
+ end
+
+ it "sets environment to sandbox" do
+ expect(Affirm.configuration.environment).to eq(:sandbox)
+ end
+
+ it "sets endpoint to sandbox" do
+ expect(Affirm.configuration.endpoint).to eq("https://sandbox.affirm.com")
+ end
end
end
private