Increase test coverage

This commit is contained in:
pfischbeck committed 2015-02-08 18:06:25 +01:00
1 parent dd37705e27
commit f989cd64db
2 files changed
+10 -5

No files matched your search

@@ -9,6 +9,10 @@ class TranslationsControllerTest < ActionController::TestCase
title: 'New title',
content: 'This is the new content',
}
@incorrect = {
title: '',
content: ''
}
@admin = admins(:admin)
end
@@ -32,6 +36,12 @@ class TranslationsControllerTest < ActionController::TestCase
assert_redirected_to problem_path(id: 1)
end
test "should not create incorrect translation" do
assert_no_difference('Translation.count') do
post :create, problem_id: 1, translation: @incorrect
end
end
test "should show translation" do
sign_in @admin
get :show, id: @translation