attributes: FactoryGirl.attributes_for(:user, name: ""), errors: { name: ["can't be blank"] } },! { attributes: FactoryGirl.attributes_for(:user, email: "janeATicloudDOTcom"), errors: { email: ["is invalid."] } }! ]! end! ! it "persists a user with valid attributes" do! user = User.create(FactoryGirl.attributes_for(:user))! ! expect(user).to be_persisted! end! ! it "does not persist if attributes are not valid" do! invalid_examples.each do |example|! user = User.create(example[:attributes])! ! expect(user).not_to be_persisted! expect(user.errors).to eq(example[:errors])! end! end! end! end!