Fix tests

This commit is contained in:
Dawa Ometto
2017-04-12 23:31:47 +02:00
parent df9382bbc3
commit cabe9f353b
11 changed files with 30 additions and 51 deletions
+3 -10
View File
@@ -21,10 +21,10 @@ context "Precious::Views::LatestChanges" do
body = last_response.body
assert body.include?('<span class="username">Charles Pence</span>'), "/latest_changes should include the Author Charles Pence"
assert body.include?('a8ad3c0'), "/latest_changes should include the :latest_changes_count commit"
assert !body.include?('60f12f4'), "/latest_changes should not include more than latest_changes_count commits"
assert body.include?('1db89eb'), "/latest_changes should include the :latest_changes_count commit"
assert !body.include?('a8ad3c0'), "/latest_changes should not include more than latest_changes_count commits"
assert body.include?('<a href="Data-Two.csv/874f597a5659b4c3b153674ea04e406ff393975e">Data-Two.csv</a>'), "/latest_changes include links to modified files in #{body}"
assert body.include?('<a href="Hobbit/874f597a5659b4c3b153674ea04e406ff393975e">Hobbit.md</a>'), "/latest_changes should include links to modified pages in #{body}"
assert body.include?('<a href="Hobbit.md/874f597a5659b4c3b153674ea04e406ff393975e">Hobbit.md</a>'), "/latest_changes should include links to modified pages in #{body}"
end
test "extract destination file name in case of path renaming" do
@@ -33,13 +33,6 @@ context "Precious::Views::LatestChanges" do
assert_equal "newDirectoryName/fileName.md", view.extract_renamed_path_destination("{oldDirectoryName => newDirectoryName}/fileName.md")
end
test "remove page extentions" do
view = Precious::Views::LatestChanges.new
assert_equal "page", view.remove_page_extentions("page.wiki")
assert_equal "page-wiki", view.remove_page_extentions("page-wiki.md")
assert_equal "file.any_extention", view.remove_page_extentions("file.any_extention")
end
teardown do
FileUtils.rm_rf(@path)
end