Skip to content

Commit

Permalink
Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
euler-room committed Oct 31, 2024
1 parent 19cdcf2 commit e352d00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions apps/dashboard/test/models/launcher_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def setup
target = Launcher.new({ project_dir: projects_path.to_s, id: '12345678', title: 'Test Script' })

assert target.save
assert Dir.entries("#{projects_path}/.ondemand/scripts").include?('12345678')
assert Dir.entries("#{projects_path}/.ondemand/launchers").include?('12345678')
end
end

Expand All @@ -36,10 +36,10 @@ def setup
target = Launcher.new({ project_dir: projects_path.to_s, id: '12345678', title: 'Test Script' })

assert target.save
assert Dir.entries("#{projects_path}/.ondemand/scripts").include?('12345678')
assert Dir.entries("#{projects_path}/.ondemand/launchers").include?('12345678')

assert target.destroy
assert_not Dir.entries("#{projects_path}/.ondemand/scripts").include?('12345678')
assert_not Dir.entries("#{projects_path}/.ondemand/launchers").include?('12345678')
end
end

Expand All @@ -61,14 +61,14 @@ def setup
OodAppkit.stubs(:dataroot).returns(projects_path)
script = Launcher.new({ project_dir: projects_path.to_s, id: '12345678', title: 'Test Script' })
assert script.save
assert Dir.entries("#{projects_path}/.ondemand/scripts").include?('12345678')
assert Dir.entries("#{projects_path}/.ondemand/launchers").include?('12345678')

target = Launcher.new({ project_dir: projects_path.to_s, id: '33333333', title: 'Not saved' })
assert_not Dir.entries("#{projects_path}/.ondemand/scripts").include?('33333333')
assert_not Dir.entries("#{projects_path}/.ondemand/launchers").include?('33333333')

assert target.destroy
assert Dir.entries("#{projects_path}/.ondemand/scripts").include?('12345678')
assert_not Dir.entries("#{projects_path}/.ondemand/scripts").include?('33333333')
assert Dir.entries("#{projects_path}/.ondemand/launchers").include?('12345678')
assert_not Dir.entries("#{projects_path}/.ondemand/launchers").include?('33333333')
end
end

Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/test/models/projects_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class ProjectsTest < ActiveSupport::TestCase
project = create_project(projects_path, template: template_dir)

assert Dir.glob(cache_json_path).present? &&
Dir.glob("#{project.directory}/.ondemand/scripts/*/cache.json").empty?
Dir.glob("#{project.directory}/.ondemand/launchers/*/cache.json").empty?
assert Dir.glob(job_log_path).present? &&
Dir.glob("#{project.directory}/.ondemand/*").exclude?("#{project.directory}/.ondemand/job_log.yml")
end
Expand Down

0 comments on commit e352d00

Please sign in to comment.