* Enable Rails cops * Fix Rails/DynamicFindBy * Fix Rails/HttpStatus * Fix Rails/Blank * Fix Rails/RequestReferer * Fix Rails/ActiveRecordAliases * Fix Rails/FindBy * Fix Rails/Presence * Fix Rails/Delegate * Fix Rails/Validation * Fix Rails/PluralizationGrammar * Fix Rails/Present * Fix Rails/Output * Fix Rails/Blank * Fix Rails/FilePath * Fix Rails/InverseOf * Fix Rails/LexicallyScopedActionFilter * Add Rails/OutputSafety to TODO * Add Rails/HasManyOrHasOneDependent to TODO * Add Rails/SkipsModelValidations to TODO
20 lines
542 B
Ruby
20 lines
542 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe "PushNotificationSubscriptions", type: :request do
|
|
let(:user) { create(:user) }
|
|
|
|
before { sign_in user }
|
|
|
|
describe "POST /push_notification_subscriptions" do
|
|
it "works" do
|
|
post "/push_notification_subscriptions", params: {
|
|
subscription: {
|
|
keys: { auth: "random", p256dh: "random" },
|
|
endpoint: "random"
|
|
}
|
|
}
|
|
expect(response).to have_http_status(:created)
|
|
expect(JSON.parse(response.body)["endpoint"]).to eq("random")
|
|
end
|
|
end
|
|
end
|