remove createUser mutation
This commit is contained in:
@@ -1,66 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe(Mutations::CreateUser) do
|
||||
describe "#resolve" do
|
||||
let(:mutation_string) do
|
||||
<<~GQL
|
||||
mutation($input: CreateUserInput!) {
|
||||
createUser(input: $input) {
|
||||
success
|
||||
errors
|
||||
}
|
||||
}
|
||||
GQL
|
||||
end
|
||||
|
||||
let(:context) do
|
||||
{
|
||||
current_auth: Auth::Profile.new({
|
||||
id: "_",
|
||||
email: "user@example.com",
|
||||
}),
|
||||
}
|
||||
end
|
||||
|
||||
let(:variables) do
|
||||
{
|
||||
input: { user: {
|
||||
firstName: "First Name",
|
||||
lastName: "Last Name",
|
||||
} },
|
||||
}
|
||||
end
|
||||
|
||||
context "when current_auth is not being used by any user" do
|
||||
it "create a user to auth" do
|
||||
result = XStakeSchema.execute(
|
||||
mutation_string,
|
||||
variables: variables,
|
||||
context: context
|
||||
).to_h
|
||||
|
||||
expect(result["data"]["createUser"]["success"]).to(eq(true))
|
||||
end
|
||||
end
|
||||
|
||||
context "when auth is being used by no users" do
|
||||
it "returns error" do
|
||||
User.create(
|
||||
first_name: "First Name",
|
||||
last_name: "Last Name",
|
||||
email: "user@example.com"
|
||||
)
|
||||
|
||||
result = XStakeSchema.execute(
|
||||
mutation_string,
|
||||
variables: variables,
|
||||
context: context
|
||||
).to_h
|
||||
|
||||
expect(result["data"]["createUser"]["success"]).to(eq(false))
|
||||
expect(result["data"]["createUser"]["errors"]).to(eq(["Validation failed: Email has already been taken"]))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,16 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
require "rails_helper"
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the HomeHelper. For example:
|
||||
#
|
||||
# describe HomeHelper do
|
||||
# describe "string concat" do
|
||||
# it "concats two strings with spaces" do
|
||||
# expect(helper.concat_strings("this","that")).to eq("this that")
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
RSpec.describe(HomeHelper, type: :helper) do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
@@ -1,16 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
require "rails_helper"
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the TailwindHelper. For example:
|
||||
#
|
||||
# describe TailwindHelper do
|
||||
# describe "string concat" do
|
||||
# it "concats two strings with spaces" do
|
||||
# expect(helper.concat_strings("this","that")).to eq("this that")
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
RSpec.describe(TailwindHelper, type: :helper) do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
Reference in New Issue
Block a user