spec/features/last_address_spec.rb in spree-last-address-2.2.0 vs spec/features/last_address_spec.rb in spree-last-address-2.2.1
- old
+ new
@@ -1,8 +1,6 @@
-require 'spec_helper'
-
-feature 'Last Address', :js do
+RSpec.feature 'Last Address', :js do
stub_authorization!
given!(:user) { create(:user) }
given!(:product) { create(:product) }
given(:address) { build(:address) }
@@ -46,18 +44,18 @@
select 'Alabama', from: "#{addr}state_id", match: :first
end
def check_address_info(kind)
addr = "order_#{kind}_address_attributes_"
- find("##{addr}lastname")['value'].should eq address.firstname
- find("##{addr}firstname")['value'].should eq address.lastname
- find("##{addr}address1")['value'].should eq address.address1
- find("##{addr}address2")['value'].should eq address.address2
- find("##{addr}city")['value'].should eq address.city
- find("##{addr}zipcode")['value'].should eq address.zipcode
- find("##{addr}phone")['value'].should eq address.phone
- find_field("#{addr}country_id").value.should eq '1'
+ expect(find("##{addr}lastname")['value']).to eq address.firstname
+ expect(find("##{addr}firstname")['value']).to eq address.lastname
+ expect(find("##{addr}address1")['value']).to eq address.address1
+ expect(find("##{addr}address2")['value']).to eq address.address2
+ expect(find("##{addr}city")['value']).to eq address.city
+ expect(find("##{addr}zipcode")['value']).to eq address.zipcode
+ expect(find("##{addr}phone")['value']).to eq address.phone
+ expect(find_field("#{addr}country_id").value).to eq '1'
end
def add_product_to_cart
visit spree.root_path
click_link product.name
@@ -67,6 +65,6 @@
def sign_in_as!(user)
fill_in 'spree_user_email', with: user.email
fill_in 'spree_user_password', with: 'secret'
click_button 'Login'
end
-end
\ No newline at end of file
+end