Skip to content

Commit

Permalink
update tests to work with developer strategy not identity
Browse files Browse the repository at this point in the history
  • Loading branch information
mfall3 committed Nov 1, 2024
1 parent a0b8c76 commit fc6413e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/integration/dataset_deposit_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class DatasetDepositTest < ActionDispatch::IntegrationTest

setup do
@user = user_identities :researcher1
@user = users :researcher1
log_in_as(@user)
end

Expand Down
4 changes: 2 additions & 2 deletions test/integration/dataset_search_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DatasetSearchTest < ActionDispatch::IntegrationTest

test "default listing for depositor" do
Dataset.all.each(&:ensure_creator_editors)
@user = user :researcher1
@user = users :researcher1
log_in_as(@user)
get datasets_path
assert_response :success
Expand All @@ -34,7 +34,7 @@ class DatasetSearchTest < ActionDispatch::IntegrationTest

test "default listing for curator" do
Dataset.all.each(&:ensure_creator_editors)
@user = user :curator1
@user = users :curator1
log_in_as(@user)
get datasets_path
assert_response :success
Expand Down
2 changes: 1 addition & 1 deletion test/integration/dataset_version_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class DatasetVersionTest < ActionDispatch::IntegrationTest

setup do
@user = user_identities :researcher1
@user = users :researcher1
log_in_as(@user)
end

Expand Down
2 changes: 1 addition & 1 deletion test/integration/orcid_api_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class OrcidApiTest < ActionDispatch::IntegrationTest

setup do
@user = user_identities :researcher1
@user = users :researcher1
log_in_as(@user)
end

Expand Down
9 changes: 5 additions & 4 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class ActiveSupport::TestCase

# Setup fixtures in test/fixtures/*.yml
fixtures :invitees, :identities, "user/identities", :datasets, :datafiles, :creators, :related_materials
fixtures :users, :datasets, :datafiles, :creators, :related_materials

def self.seeding?
@@seeding
Expand All @@ -18,9 +18,10 @@ def self.seeding?
# (local, non-shibboleth) identity provider is assumed
#
def log_in_as(user)
post "/auth/identity/callback", params: {
auth_key: user.email,
password: "password"
post "/auth/developer/callback", params: {
email: user.email,
name: user.name,
role: user.role
}
end

Expand Down

0 comments on commit fc6413e

Please sign in to comment.