2019-03-30 03:23:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-11-26 10:16:50 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 14:09:03 -04:00
|
|
|
RSpec.describe StripAttribute do
|
2015-11-26 10:16:50 -05:00
|
|
|
let(:milestone) { create(:milestone) }
|
|
|
|
|
|
|
|
describe ".strip_attributes" do
|
|
|
|
it { expect(Milestone).to respond_to(:strip_attributes) }
|
|
|
|
it { expect(Milestone.strip_attrs).to include(:title) }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "#strip_attributes" do
|
|
|
|
before do
|
|
|
|
milestone.title = ' 8.3 '
|
|
|
|
milestone.valid?
|
|
|
|
end
|
|
|
|
|
|
|
|
it { expect(milestone.title).to eq('8.3') }
|
|
|
|
end
|
|
|
|
end
|