Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
carsoncole committed Oct 18, 2022
1 parent ba29bdf commit e555dcb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 33 deletions.
17 changes: 7 additions & 10 deletions test/models/user_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ class UserTest < ActiveSupport::TestCase
assert user.owner_or_admin?(project)
end

# test "user-created projects don't remain after destroying user if they are owner" do
# user = create(:user)
# user_project = user.user_projects.last
# project = user.user_projects.last

# assert_equal user_project.role, "owner"

# assert user.destroy
# assert_not Project.find_by(id: project.id)
# end
test "user-created projects don't remain after destroying user if they are owner" do
user = create(:user)
project = user.projects.create(attributes_for(:project))
assert_equal project.user_projects.where(user: user).first.role, "owner"
assert user.destroy
assert_not Project.find_by(id: project.id)
end
end
23 changes: 0 additions & 23 deletions test/system/users_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,6 @@ class UsersTest < ApplicationSystemTestCase
assert_selector "h1", text: "Projects"
end

# test "a non-Martech user enters their email on landing page" do
# visit root_url
# fill_in "primary-email-field", with: Faker::Internet.email
# click_on "primary-signup-button"
# fill_in "Password", with: Faker::Internet.password
# click_on "Sign up"
# assert_selector "#error_explanation"
# assert_selector "li", text: "Email is not an allowable email domain"
# end

# test "a non-Martech user signing up" do
# visit sign_up_url
# fill_in "Email", with: Faker::Internet.email
# fill_in "Password", with: Faker::Internet.password
# click_on "Sign up"
# assert_selector "#error_explanation"
# assert_selector "li", text: "Email is not an allowable email domain"
# end

test "projects index page after signing in" do
sign_in_as(users(:standard))
assert_selector "h1", text: "Projects"
Expand All @@ -51,8 +32,4 @@ class UsersTest < ApplicationSystemTestCase
click_on "Sign out"
assert_selector "h1", text: "Sign in"
end

#TODO user test
test "only owner can destroy owned projects" do
end
end

0 comments on commit e555dcb

Please sign in to comment.