1
0
mirror of https://github.com/projekteuler/projekteuler.git synced 2026-01-26 18:18:51 +01:00

Add about pages

This commit is contained in:
2017-11-24 14:26:48 +01:00
parent 703975adf5
commit f5d0e721a1
22 changed files with 364 additions and 24 deletions

View File

@@ -0,0 +1,29 @@
require 'test_helper'
class AboutControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get about_index_url
assert_response :success
end
test "should get info" do
get about_info_url
assert_response :success
end
test "should get copyright" do
get about_copyright_url
assert_response :success
end
test "should get legal" do
get about_legal_url
assert_response :success
end
test "should get roman_numerals" do
get about_roman_numerals_url
assert_response :success
end
end

View File

@@ -18,12 +18,17 @@ class ProblemTest < ActiveSupport::TestCase
assert_equal "https://projecteuler.net/problem=1", problems(:one).original_url
end
test "should return correct number of translated problems" do
assert_equal 2, Problem.translated_count
end
test "should allow for problem count updating" do
Problem.update_count(10)
assert_not Problem.where(id: 0).exists?
(1..10).each do |i|
assert Problem.where(id: i).exists?
end
assert_not Problem.where(id: 11).exists?
assert_equal "First title", Problem.find(1).title
end
@@ -33,5 +38,6 @@ class ProblemTest < ActiveSupport::TestCase
Problem.update_count(1)
end
assert_equal 3, Problem.count()
assert_equal "First title", Problem.find(1).title
end
end