-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests for activating lists, both your own and shared
- Loading branch information
1 parent
dfb83f9
commit c8dec6d
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
spec/requests/active_personal_space_lists_controller_spec.rb
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rails_helper" | ||
|
||
RSpec.describe ActivePersonalSpaceList, type: :request do | ||
let(:user) { Fabricate(:user) } | ||
let(:users_space_list) { Fabricate(:personal_space_list, user:) } | ||
let(:someone_elses_space_list) { Fabricate(:personal_space_list) } | ||
|
||
before do | ||
sign_in user | ||
end | ||
|
||
it "can activate and deactivate a list" do | ||
expect(user.active_personal_space_list).to be_nil | ||
|
||
post activate_personal_space_list_personal_space_list_path(id: users_space_list.id) | ||
expect(user.reload.active_personal_space_list.personal_space_list_id).to be(users_space_list.id) | ||
|
||
post deactivate_personal_space_list_personal_space_list_path(id: users_space_list.id) | ||
expect(user.reload.active_personal_space_list).to be_nil | ||
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