diff options
author | Jérémy FRERE <frere.jeremy@gmail.com> | 2013-10-24 16:28:39 +0200 |
---|---|---|
committer | Philip Arndt <git@p.arndt.io> | 2015-05-14 09:52:29 +1200 |
commit | 95db4b6299c026a67ad61067b83882b862678be6 (patch) | |
tree | d770d069a831886cd4acf2f9ee8869693923e029 /spec/controllers/refinery/blog | |
parent | 2f0483ede301e6b8ac11389051d67e126e40998c (diff) | |
download | refinerycms-blog-95db4b6299c026a67ad61067b83882b862678be6.tar.gz refinerycms-blog-95db4b6299c026a67ad61067b83882b862678be6.tar.bz2 refinerycms-blog-95db4b6299c026a67ad61067b83882b862678be6.zip |
Adds spec to check no other translation had been deleted
Diffstat (limited to 'spec/controllers/refinery/blog')
-rw-r--r-- | spec/controllers/refinery/blog/admin/posts_controller_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/controllers/refinery/blog/admin/posts_controller_spec.rb b/spec/controllers/refinery/blog/admin/posts_controller_spec.rb index b415c9d..03ae7ec 100644 --- a/spec/controllers/refinery/blog/admin/posts_controller_spec.rb +++ b/spec/controllers/refinery/blog/admin/posts_controller_spec.rb @@ -11,6 +11,7 @@ module Refinery before do blog_post.translations.create(:locale => :fr, :title => 'Un titre francais', :body => "La baguette, c'est bon. Mangez-en.") + blog_post.translations.create(:locale => :es, :title => 'Un titulo espanol', :body => "Mi casa e su casa.") end it "destroys the translation" do @@ -18,6 +19,11 @@ module Refinery blog_post.translations.exists?(:locale => :fr).should be_false end + it "does not destroy other translations" do + post :delete_translation, :id => blog_post.id, :locale_to_delete => :fr + blog_post.translations.exists?(:locale => :es).should be_true + end + it "redirects on success" do post :delete_translation, :id => blog_post.id, :locale_to_delete => :fr response.should be_redirect |