Refactor sluggable concern spec
This commit is contained in:
@@ -3,13 +3,12 @@ require 'spec_helper'
|
||||
shared_examples_for 'sluggable' do
|
||||
|
||||
describe 'generate_slug' do
|
||||
before do
|
||||
create(described_class.name.parameterize.tr('-', '_').to_sym, name: "Marlo Brañido Carlo")
|
||||
end
|
||||
let(:factory_name) { described_class.name.parameterize('_').to_sym }
|
||||
let(:sluggable) { create(factory_name, name: "Marló Brañido Carlo") }
|
||||
|
||||
context "when a new sluggable is created" do
|
||||
it "gets a slug string" do
|
||||
expect(described_class.last.slug).to eq("marlo-branido-carlo")
|
||||
expect(sluggable.slug).to eq("marlo-branido-carlo")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user