Enable RSpec/FilePath cop and fix all issues

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath
This commit is contained in:
Bertocq
2018-01-07 02:05:08 +01:00
parent 0f37239ac3
commit 95733f52f2
6 changed files with 3 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
require 'rails_helper'
describe Verification::Sms do
it "is valid" do
sms = build(:verification_sms)
expect(sms).to be_valid
end
it "validates uniqness of phone" do
create(:user, confirmed_phone: "699999999")
sms = described_class.new(phone: "699999999")
expect(sms).to_not be_valid
end
it "only allows spaces, numbers and the + sign" do
expect(build(:verification_sms, phone: "0034 666666666")).to be_valid
expect(build(:verification_sms, phone: "+34 666666666")).to be_valid
expect(build(:verification_sms, phone: "hello there")).to_not be_valid
expect(build(:verification_sms, phone: "555; DROP TABLE USERS")).to_not be_valid
end
end