Last active
May 4, 2024 10:30
-
-
Save Bodacious/92dd9307d4ec5b870bf4da667b815611 to your computer and use it in GitHub Desktop.
Reply to tweet example
This file contains hidden or 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
describe "PATCH /settings" do | |
context "as a partner" do | |
it "behaves like a user without access" do | |
user = create(:partner, company:) | |
params = { company: { website: "https://domain.suffix" } } | |
headers = { "Accept" => "text/vnd.turbo-stream.html" } | |
patch(settings_path, params: params, headers: headers) | |
expect(response).to be_unauthorized | |
end | |
end | |
context "as a mechanic" do | |
it "behaves like a user without access" do | |
user = create(:mechanic, company:) | |
params = { company: { website: "https://domain.suffix" } } | |
headers = { "Accept" => "text/vnd.turbo-stream.html" } | |
patch(settings_path, params: params, headers: headers) | |
expect(response).to be_unauthorized | |
end | |
end | |
context "as sales_2" do | |
it "behaves like a user without access" do | |
user = create(:sales_2, company:) | |
params = { company: { website: "https://domain.suffix" } } | |
headers = { "Accept" => "text/vnd.turbo-stream.html" } | |
patch(settings_path, params: params, headers: headers) | |
expect(response).to be_unauthorized | |
end | |
end | |
context "as sales" do | |
it "behaves like a user without access" do | |
user = create(:sales, company:) | |
params = { company: { website: "https://domain.suffix" } } | |
headers = { "Accept" => "text/vnd.turbo-stream.html" } | |
patch(settings_path, params: params, headers: headers) | |
expect(response).to be_unauthorized | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment