spec/models/dorsale/address_spec.rb in dorsale-3.8.1 vs spec/models/dorsale/address_spec.rb in dorsale-3.9.0
- old
+ new
@@ -1,46 +1,46 @@
-require 'rails_helper'
+require "rails_helper"
module Dorsale
RSpec.describe Address, :type => :model do
it { should belong_to :addressable }
it { should validate_presence_of :addressable }
- describe '#one_line' do
- it 'should build a one line address' do
- address = Address.create(
- street: '3 Rue Marx Dormoy',
- street_bis: 'L\'atelier',
- zip: '13004',
- city: 'Marseille',
- country: 'France'
+ describe "#one_line" do
+ it "should build a one line address" do
+ address = Address.new(
+ street: "3 Rue Marx Dormoy",
+ street_bis: "L'atelier",
+ zip: "13004",
+ city: "Marseille",
+ country: "France",
)
- expect(address.one_line).to eq('3 Rue Marx Dormoy, L\'atelier, 13004 Marseille, France')
+ expect(address.one_line).to eq("3 Rue Marx Dormoy, L'atelier, 13004 Marseille, France")
end
- it 'should remove useless commas' do
- address = Address.create(
- street: '3 Rue Marx Dormoy',
- street_bis: '',
- zip: '13004',
- city: 'Marseille',
- country: ''
+ it "should remove useless commas" do
+ address = Address.new(
+ street: "3 Rue Marx Dormoy",
+ street_bis: "",
+ zip: "13004",
+ city: "Marseille",
+ country: "",
)
- expect(address.one_line).to eq('3 Rue Marx Dormoy, 13004 Marseille')
+ expect(address.one_line).to eq("3 Rue Marx Dormoy, 13004 Marseille")
end
- it 'should remove useless commas' do
- address = Address.create(
- street: '3 Rue Marx Dormoy',
- street_bis: '',
- zip: '',
- city: 'Marseille',
- country: ''
+ it "should remove useless commas" do
+ address = Address.new(
+ street: "3 Rue Marx Dormoy",
+ street_bis: "",
+ zip: "",
+ city: "Marseille",
+ country: "",
)
- expect(address.one_line).to eq('3 Rue Marx Dormoy, Marseille')
+ expect(address.one_line).to eq("3 Rue Marx Dormoy, Marseille")
end
end
end
end