forked from ontoportal/ontologies_api
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor test to be faster by doing the indexation only if needed
- Loading branch information
1 parent
f7eaf98
commit b5360d2
Showing
12 changed files
with
108 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,10 @@ def self._set_vars | |
administeredBy: "tim", | ||
"file" => Rack::Test::UploadedFile.new(@@test_file, ""), | ||
released: DateTime.now.to_s, | ||
contact: [{name: "test_name", email: "[email protected]"}] | ||
contact: [{name: "test_name", email: "[email protected]"}], | ||
URI: 'https://test.com/test', | ||
status: 'production', | ||
description: 'ontology description' | ||
} | ||
@@status_uploaded = "UPLOADED" | ||
@@status_rdf = "RDF" | ||
|
@@ -36,6 +39,12 @@ def self._create_onts | |
ont.save | ||
end | ||
|
||
def setup | ||
delete_ontologies_and_submissions | ||
ont = Ontology.new(acronym: @@acronym, name: @@name, administeredBy: [@@user]) | ||
ont.save | ||
end | ||
|
||
def test_submissions_for_given_ontology | ||
num_onts_created, created_ont_acronyms = create_ontologies_and_submissions(ont_count: 1) | ||
ontology = created_ont_acronyms.first | ||
|
@@ -156,13 +165,13 @@ def test_download_acl_only | |
begin | ||
allowed_user = User.new({ | ||
username: "allowed", | ||
email: "test@example.org", | ||
email: "test4@example.org", | ||
password: "12345" | ||
}) | ||
allowed_user.save | ||
blocked_user = User.new({ | ||
username: "blocked", | ||
email: "test@example.org", | ||
email: "test5@example.org", | ||
password: "12345" | ||
}) | ||
blocked_user.save | ||
|
@@ -235,5 +244,4 @@ def test_ontology_submissions_access_controller | |
del.delete if del | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters