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
26 lines
740 B
Ruby
26 lines
740 B
Ruby
require "test_helper"
|
|
|
|
class ProjectRepoMappingTest < ActiveSupport::TestCase
|
|
test "archive and unarchive toggle archived state" do
|
|
user = User.create!
|
|
mapping = user.project_repo_mappings.create!(project_name: "hackatime")
|
|
|
|
assert_not mapping.archived?
|
|
|
|
mapping.archive!
|
|
assert mapping.reload.archived?
|
|
|
|
mapping.unarchive!
|
|
assert_not mapping.reload.archived?
|
|
end
|
|
|
|
test "project name must be unique per user" do
|
|
user = User.create!
|
|
user.project_repo_mappings.create!(project_name: "same-project")
|
|
|
|
duplicate = user.project_repo_mappings.build(project_name: "same-project")
|
|
|
|
assert_not duplicate.valid?
|
|
assert_includes duplicate.errors[:project_name], "has already been taken"
|
|
end
|
|
end
|