Skip to content

Commit

Permalink
Add failing spec for updating translated slugs
Browse files Browse the repository at this point in the history
  • Loading branch information
shioyama committed Aug 5, 2018
1 parent f5d952f commit 35c4e6c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/friendly_id/mobility_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@
expect(journalist.slug_en).to be_nil
end
end

# Ref: https://github.com/shioyama/friendly_id-mobility/issues/10
it "regenerates slug records for all locales with present values" do
article = Article.new(title_en: "English title", title_es: "Título español")
article.save

article.slug_en = nil
article.slug_es = nil
article.save

expect(article.slug_en).to eq("english-title")
expect(article.slug_es).to eq("titulo-espanol")
end
end

describe "#to_param" do
Expand Down

0 comments on commit 35c4e6c

Please sign in to comment.