2019-03-30 07:23:56 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-11-26 15:16:50 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 18:09:03 +00:00
|
|
|
RSpec.describe StripAttribute do
|
2015-11-26 15:16:50 +00: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
|