A mobile-friendly web application where visitors may book a one-way flight for multiple passengers.
A mobile-friendly website where registered users may create private or public events and mark events they are attending.
A mobile-friendly site where registered users may post stories, but only registered users may view the author of each story.
A terminal game of Mastermind in which the user can choose to play as the codemaster or codebreaker. The computer is guaranteed to guess correctly within 5 tries.
Summary of changes:
test/fixtures/users.yml
It was just missing a newline at the end of the file!
test/integration/user_account_test.rb
Testing the correct response after signing in and out.
Potential cause for concern:
test/integration/user_account_test.rb:9
You may notice that the test for signing in uses the hard-coded parameter password: 'password'
. It needs to be hard-coded because the fixture (just like the db) stores the encrypted_password
. However, Rails expects a plaintext password as the parameter. You cannot pass in users(:one).encrypted_password
, as it will receive the hash instead and fail to sign in.
The cleanest implementation involves replacing the entire post
method with this single line:
sign_in users(:one)
However, this would not have the added benefit of testing the /sign_in
request. Please let me know if you prefer that I use the sign_in
helper method instead.
Closes issue: #87
update readme
Merge pull request #91 from kasugaijin/update_readme
update readme
add adopter profile review tests to check that verified staff can access a profile, and unverified staff cannot.
Merge pull request #92 from kasugaijin/adopter_profile_review
add adopter profile review tests to check that verified staff can acc…
I would like to take this!
For the sake of manually testing: that page renders perfectly fine for me
The page where it asks you a bunch of questions right after registering as an adopter. It contains the following text at the top:
The following questions help us learn more about you so we can match you with the right pooch.
Firefox versions tested: 110.0b5 (Latest dev) 108.0.2 (Latest stable)
OS: Pop!_OS 22.04 (it's based on Ubuntu)
Add test that ensures Create Adoption button shows
Add test that ensures application disappears after adoption created
Add test that ensures a new Adoption is created after http request sent
Use instance variables instead of fixture references
Add test that ensures an application reappears on adopter's applications page
update readme
update readme
Merge pull request #79 from kasugaijin/update_readme
update readme
Merge pull request #80 from kasugaijin/update_readme
update readme
Refactor test that asserts application disappears after adoption created
Shorten name of test
Add test that ensures unverified staff cannot create an adoption
Add assertion that flash message appears when adoption created
Merge branch 'main' into more_adoption_review_tests
Add simplecov gem to test scope and add the require and init in the test helper along with a check for presence of ENV variable when calling test in the terminal. Add check in config for test environment to eager load the application if the coverage ENV variable is present.
update readme and clean up old commented out code in controller
Merge pull request #83 from kasugaijin/simplecov_gem
Simplecov gem
update readme
Merge pull request #84 from kasugaijin/update_readme
update readme
Set default url options for test environment
feat: remove title column from posts
feat: add user reference to posts
feat: create associations between users and posts
feat: add new and create routes for posts
feat: create new posts
test: add Devise integration helpers to PostsControllerTest
test: ensure new post is created
feat: add link to create new post
feat: display list of all posts
feat: generate Like model
feat: define association between users, likes and posts
refactor: remove date_created column from posts
feat: ignore linter config files
feat: add route for LikesController#create
feat: generate LikesController
feat: allow user to like posts
test: add post fixture
test: ensure like is created
feat: add destroy route for likes
feat: enable user to unlike posts
Add test that ensures staff can edit adoption application status
Add test that ensures staff can add notes to an application
Refactor test that ensures staff can edit application status
Add test that ensures unverified staff cannot edit an application status
Add test that ensures unverified staff cannot add notes to an application
refactor tests to reference dog fixture
add newline to end of file
refactor tests to reference fixtures instead of querying db
refactor test to add ID directly in fixture
Refactor test to use from and to argument
Push footer down by fixing comments
Merge pull request #77 from Overlandcoder/push_footer_down
/donate page - push the footer to the bottom
Merge pull request #74 from Overlandcoder/edit_app_status_test
Adoption application reviews tests: staff can edit app status, add notes
Merge pull request #75 from Eduardo06sp/test/add-fixture-references
Use fixture references instead of active record queries
Perfect! I did push the change just yesterday.
So my PR is fully up to date as of now!
I really appreciate the explanation! So now that I understand it much better, I realized that we can still go ahead and refactor this test.
I'll update my PR to explain the change, but essentially: you can still explicitly assign IDs in fixtures. If you don't, you get those super random, long numbers (these are simply autogenerated IDs).
refactor test to add ID directly in fixture
Summary of changes:
app/controllers/registrations_controller.rb
I added a newline at the end of the file!
test/integration/adoptable_dog_show_test.rb
test/integration/adopter_application_test.rb
test/integration/user_account_test.rb
For these, I simply added references to the fixtures instead of querying the db directly.
test/integration/org_dogs_test.rb
I noticed that you were looking for a Dog's id, and in other cases, using the same Dog record itself (instead of just its id).
Thus, I found it appropriate to store the @dog
instance variable instead of just its id. I had to refactor some lines and reload the fixture sometimes.
Regardless, I ensured the entire suite of tests passed on my end. Please let me know if I missed or should adjust anything.
Closes issue: #72
Question:
You have a test (integration/user_account_test
) where you test the following behavior:
"Staff user can sign up with an unverified staff account belonging to organization id 1 and see success flash"
https://github.com/kasugaijin/baja-pet-rescue/blob/main/test/integration/user_account_test.rb#L36
Here is part of the test I'm referring to (that I linked):
# set org id to 1 to match db default value. Cannot pass org_id as it's not permitted param.
organization = Organization.find_by(name: 'for_staff_sign_up')
organization.id = 1
organization.save
You then proceed to create a new user.
I'm going to move on from this issue, but if I delete the lines
organization.id = 1
organization.save
then the User is no longer saved.
My question is: at what point is that organization ID used in the user registration process?
I tried following along the flow in which users are registered. But I don't see the point in which a staff account is created and being assigned an organization ID. I noticed that even in the registrations controller, there is no create action (so I assume it uses the default Devise one).
I don't understand why it would prevent a user account from being saved, as the validations don't point to anything.
test for presence of validation messages on contact form
add validation messages to contact form view
test for successful contact form submission
test for email delivery upon submitting contact form
Merge pull request #57 from Eduardo06sp/test/contact-form
Contact form tests
fix fixtures to add another dog so the adopter applications test page can have two applications in place
add first two tests
use rails default helper path instead of request referrer because integration tests are not able to redirect to nil
add tests to ensure withdraw and remove buttns work as intended
add test to ensure adopter application status reflects that when changed by staff
add test to ensure staff can revert a withdrawn application
Add test for dog name
Merge pull request #59 from kasugaijin/adopter_applications_test
Adopter applications test
update error message to be consistent with validation;
add tests to ensure dogs can be paused and unpaused approiately
add test to upload attachments on dog
Add test for uploading and deleting attachments on a dog
add test method to test helper and add callback after teardown to clear active storage attachments
remove unnecessary comments
add filter to make sure only verified staff can delete an attachment/image
I would like to take this!
refactor: use resourceful routes for Users
feat: add nav
feat: generate Notification model
feat: set new session path as redirect location after signing out
feat: add route for notifications
feat: generate Notifications controller
feat: add notifications association to User
feat: add notifications to nav
feat: list all notifications within notifications index view
feat: add counter cache for notifications
feat: display notification size in nav
feat: notify friend upon friend request acceptance
test: use click_button instead of click_on within UsersTest
feat: send friend parameter when sending friend request
feat: notify user after creating friend request
refactor: use around_action to ensure friend request and notification are sent together
test: send friend param when creating friend requests
refactor: remove error-handling code from FriendRequestsController#create
test: store friend request count in variable
test: ensure notification is created after sending friend request
docs: describe the work-in-progress app
docs: remove information regarding live deployment
docs: remove information regarding live deployment
docs: remove information regarding live deployment
test: generate system tests for Users
test: use Firefox for system tests
test: ensure User can register
test: ensure User can log in
feat: create friend association
feat: create friend requests
feat: add associations between users and friend requests
feat: generate UsersController
feat: list all users within index view
fix: comment out unused fixture data
fix: comment out unused functional test
feat: generate FriendRequestsController
feat: allow users to send friend requests
test: generate friend request integration test file
feat: generate FriendsController
feat: allow user to accept friend requests
feat: allow users to decline friend requests
feat: make both users friends of one another when creating Friends
feat: do not display currently logged in user in list of users
feat: redirect to previous page when creating/destroying FriendRequests
refactor: add current directory in path
test for email delivery upon submitting contact form