aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/refinery/blog
diff options
context:
space:
mode:
authorJérémy FRERE <frere.jeremy@gmail.com>2013-10-24 16:28:39 +0200
committerPhilip Arndt <git@p.arndt.io>2015-05-14 09:52:29 +1200
commit95db4b6299c026a67ad61067b83882b862678be6 (patch)
treed770d069a831886cd4acf2f9ee8869693923e029 /spec/controllers/refinery/blog
parent2f0483ede301e6b8ac11389051d67e126e40998c (diff)
downloadrefinerycms-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.rb6
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