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:
29
test/controllers/about_controller_test.rb
Normal file
29
test/controllers/about_controller_test.rb
Normal 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user