@@ -32,6 +32,7 @@ module Spree::Api
3232 "meta_description" => nil ,
3333 "meta_keywords" => nil ,
3434 "seo_title" => nil ,
35+ "reverse_charge_status" => 'disabled' ,
3536 "mail_from_address" => "solidus@example.org" ,
3637 "bcc_email" => nil ,
3738 "default_currency" => nil ,
@@ -46,6 +47,7 @@ module Spree::Api
4647 "meta_description" => nil ,
4748 "meta_keywords" => nil ,
4849 "seo_title" => nil ,
50+ "reverse_charge_status" => 'disabled' ,
4951 "mail_from_address" => "solidus@example.org" ,
5052 "bcc_email" => nil ,
5153 "default_currency" => nil ,
@@ -65,6 +67,7 @@ module Spree::Api
6567 "meta_description" => nil ,
6668 "meta_keywords" => nil ,
6769 "seo_title" => nil ,
70+ "reverse_charge_status" => 'disabled' ,
6871 "mail_from_address" => "solidus@example.org" ,
6972 "bcc_email" => nil ,
7073 "default_currency" => nil ,
@@ -112,6 +115,36 @@ module Spree::Api
112115 expect ( response . status ) . to eq ( 204 )
113116 end
114117 end
118+
119+ context "reverse_charge_status attribute" do
120+ it "can create a new store with reverse_charge_status" do
121+ store_hash = {
122+ code : "spree123" ,
123+ name : "Hack0rz" ,
124+ url : "spree123.example.com" ,
125+ mail_from_address : "me@example.com" ,
126+ reverse_charge_status : "enabled"
127+ }
128+ post spree . api_stores_path , params : { store : store_hash }
129+ expect ( response . status ) . to eq ( 201 )
130+ expect ( json_response [ "reverse_charge_status" ] ) . to eq ( 'enabled' )
131+ end
132+
133+ it "can update an existing store with reverse_charge_status" do
134+ store_hash = {
135+ url : "spree123.example.com" ,
136+ mail_from_address : "me@example.com" ,
137+ bcc_email : "bcc@example.net" ,
138+ reverse_charge_status : "disabled"
139+ }
140+ put spree . api_store_path ( store ) , params : { store : store_hash }
141+ expect ( response . status ) . to eq ( 200 )
142+ expect ( store . reload . url ) . to eql "spree123.example.com"
143+ expect ( store . reload . mail_from_address ) . to eql "me@example.com"
144+ expect ( store . reload . bcc_email ) . to eql "bcc@example.net"
145+ expect ( store . reload . reverse_charge_status ) . to eql "disabled"
146+ end
147+ end
115148 end
116149
117150 context "as an user" do
0 commit comments