hackatime/test/models/repository_test.rb
Mahad Kalam 44777ad644
Data export fix + async exports + more tests (#989)
* 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
2026-02-21 11:28:21 +00:00

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