diff --git a/app/models/dmptemplate.rb b/app/models/dmptemplate.rb index 789635e..2289167 100644 --- a/app/models/dmptemplate.rb +++ b/app/models/dmptemplate.rb @@ -128,7 +128,6 @@ end # TODO: Remove this! We should not be attempting to access an Org attribute through this class - ## # Returns the string name of the organisation type of the organisation who # owns this dmptemplate diff --git a/test/unit/dmptemplate_test.rb b/test/unit/dmptemplate_test.rb index 76a3617..32ee18d 100644 --- a/test/unit/dmptemplate_test.rb +++ b/test/unit/dmptemplate_test.rb @@ -230,64 +230,6 @@ assert_equal(default_formatting, @template.settings(:export).formatting) end - # ---------- templates_org_type ---------- - test "templates_org_type returns all published" do - OrganisationType.find_each do |org_type| - result_templates = Dmptemplate.templates_org_type(org_type.name) - my_list = Array.new - org_type.organisations.each do |org| - my_list += org.dmptemplates - end - my_list.each do |template| - if template.published - assert_includes(result_templates, template, "Template: #{template.title}} of type #{org_type.name}, not returned by templates_org_type") - end - end - end - end - - # ---------- funders_templates ---------- - test "funders_templates returns all funder organisation templates" do - result_templates = Dmptemplate.funders_templates - funder_templates = OrganisationType.first.organisations do |org| - org.dmptemplates.each do |template| - assert_includes( result_templates, template, "Funder Template: #{template.title} not included in result of funders_templates") - end - end - end - - # ---------- own_institutional_templates ---------- - test "own_institutional_templates returns all templates belonging to given org_id" do - Organisation.find_each do |org| - result_templates = Dmptemplate.own_institutional_templates(org.id) - org.dmptemplates.each do |template| - assert_includes(result_templates, template, "Template: #{template.title} not returned by own_institutional_templates") - end - end - end - - # ---------- funders_and_own_templates ---------- - test "funders_and_own_templates returns all funder and own given org_id templates" do - Organisation.find_each do |org| - result_templates = Dmptemplate.funders_and_own_templates(org.id) - org.dmptemplates.each do |template| - assert_includes(result_templates, template, "Template #{template.title} not returned by funders and own templates") - end - end - funder_templates = OrganisationType.first.organisations do |org| - org.dmptemplates.each do |template| - assert_includes( result_templates, template, "Funder Template: #{template.title} not included in result of funders_and_own_templates") - end - end - end - - # ---------- org_type ---------- - test "org_type properly returns the name of the template's organisation's type" do - Dmptemplate.find_each do |template| - assert_equal( template.org_type, template.organisation.organisation_type.name, "Template: #{template.title} returned #{template.org_type}, instead of #{template.organisation.organisation_type.name}") - end - end - # ---------- has_customisations? ---------- test "has_customisations? correctly identifies if a given org has customised the template" do # TODO: Impliment after understanding has_customisations