diff options
Diffstat (limited to 'spec/models/profile_spec.rb')
-rw-r--r-- | spec/models/profile_spec.rb | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb index a6d941d1d..00a160bac 100644 --- a/spec/models/profile_spec.rb +++ b/spec/models/profile_spec.rb @@ -245,30 +245,31 @@ describe Profile, :type => :model do end end - describe 'tags' do - before do - person = FactoryGirl.build(:person) - @object = person.profile - end - it 'allows 5 tags' do - @object.tag_string = '#one #two #three #four #five' + describe "tags" do + let(:object) { FactoryGirl.build(:person).profile } + + it "allows 5 tags" do + object.tag_string = "#one #two #three #four #five" - @object.valid? - @object.errors.full_messages + object.valid? + object.errors.full_messages - expect(@object).to be_valid + expect(object).to be_valid end - it 'strips more than 5 tags' do - @object.tag_string = '#one #two #three #four #five #six' - @object.save - expect(@object.tags.count).to eq(5) + + it "strips more than 5 tags" do + object.tag_string = "#one #two #three #four #five #six" + object.save + expect(object.tags.count).to eq(5) end - it 'should require tag name not be more than 255 characters long' do - @object.tag_string = "##{'a' * (255+1)}" - @object.save - expect(@object).not_to be_valid + + it "should require tag name not be more than 255 characters long" do + object.tag_string = "##{'a' * (255 + 1)}" + object.save + expect(object).not_to be_valid end - it_should_behave_like 'it is taggable' + + it_should_behave_like "it is taggable" end describe "#tombstone!" do |