Sha256: e5038a1f0c4f151392a10fcc6eb146e9b437eb8a3d681f9620cbceccd20e11bd

Contents?: true

Size: 628 Bytes

Versions: 7

Compression:

Stored size: 628 Bytes

Contents

require 'spec_helper'

describe Storytime::Navigation do
  describe "#handle" do
    it "parameterizes the title to set the handle" do
      nav = FactoryGirl.create(:navigation, handle: nil)
      expect(nav.handle).to eq nav.name.parameterize
    end

    it "parameterizes the handle" do
      nav = FactoryGirl.create(:navigation, handle: "my Handle")
      expect(nav.handle).to eq "my-handle"
    end

    it "does not change the handle if the title changes" do
      nav = FactoryGirl.create(:navigation, handle: "my Handle")
      nav.update(name: "New Name")
      expect(nav.handle).to eq "my-handle"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
storytime-2.1.6 spec/models/navigation_spec.rb
storytime-2.1.5 spec/models/navigation_spec.rb
storytime-2.1.4 spec/models/navigation_spec.rb
storytime-2.1.3 spec/models/navigation_spec.rb
storytime-2.1.2 spec/models/navigation_spec.rb
storytime-2.1.1 spec/models/navigation_spec.rb
storytime-2.1.0 spec/models/navigation_spec.rb