2015-11-26 10:16:50 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-04-25 08:28:55 -04:00
|
|
|
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
|