mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 19:55:16 +00:00
* Fix data export + Capybara * Continue? * A ton of system tests :D + test cleanup * More system tests * Add placeholder keys for tests? * Get rid of the double-query! * Speed up CI Chrome setup by avoiding snap installs * Pin CI Chrome version to reduce system test flakiness * Stabilize integrations settings system test interaction
17 lines
579 B
Ruby
17 lines
579 B
Ruby
require "test_helper"
|
|
|
|
class RepositoryTest < ActiveSupport::TestCase
|
|
test "parse_url extracts host owner and name" do
|
|
parsed = Repository.parse_url("https://github.com/hackclub/hackatime")
|
|
|
|
assert_equal "github.com", parsed[:host]
|
|
assert_equal "hackclub", parsed[:owner]
|
|
assert_equal "hackatime", parsed[:name]
|
|
end
|
|
|
|
test "formatted_languages truncates to top three with ellipsis" do
|
|
repository = Repository.new(languages: "Ruby, JavaScript, TypeScript, Go")
|
|
|
|
assert_equal "Ruby, JavaScript, TypeScript...", repository.formatted_languages
|
|
end
|
|
end
|