Refactor attribute_spec.rb to conform with Let's Not style (#1339)

This commit is contained in:
Richie Thomas 2019-10-16 08:38:21 -07:00 committed by GitHub
parent e98a4aae15
commit 686b6cb9d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 4 deletions

View File

@ -1,7 +1,15 @@
describe FactoryBot::Attribute do
let(:name) { "user" }
subject { FactoryBot::Attribute.new(name, false) }
it "converts the name attribute to a symbol" do
name = "user"
attribute = FactoryBot::Attribute.new(name, false)
its(:name) { should eq name.to_sym }
it { should_not be_association }
expect(attribute.name).to eq name.to_sym
end
it "is not an association" do
name = "user"
attribute = FactoryBot::Attribute.new(name, false)
expect(attribute).not_to be_association
end
end