add create sell and buy crypto order mutations

This commit is contained in:
João Geonizeli
2021-08-15 01:59:59 -03:00
parent 4b1341677f
commit a3d32ee13a
25 changed files with 688 additions and 15 deletions

View File

@@ -0,0 +1,16 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe(Types::BuyCryptoOrderType) do
subject { described_class }
describe "arguments" do
it { is_expected.to(have_a_field(:id).of_type("ID!")) }
it { is_expected.to(have_a_field(:currency).of_type("Currency!")) }
it { is_expected.to(have_a_field(:paid_amount_cents).of_type("Int!")) }
it { is_expected.to(have_a_field(:received_amount).of_type("String")) }
it { is_expected.to(have_a_field(:status).of_type("ProcessStatus!")) }
it { is_expected.to(have_a_field(:created_at).of_type("ISO8601DateTime!")) }
it { is_expected.to(have_a_field(:updated_at).of_type("ISO8601DateTime!")) }
end
end

View File

@@ -0,0 +1,9 @@
# frozen_string_literal: true
require "rails_helper"
describe Types::ProcessStatusEnum do
describe "values" do
it { expect(described_class.values.keys).to(match(["PROCESSING", "COMPLETED", "CANCELED"])) }
end
end

View File

@@ -0,0 +1,14 @@
# frozen_string_literal: true
require "rails_helper"
describe Types::RecordInvalidType do
subject { described_class }
describe "fields" do
it { is_expected.to(have_field(:full_messages).of_type("[String!]!")) }
it { is_expected.to(have_field(:field_name).of_type("String")) }
it { is_expected.to(have_field(:messages).of_type("[String!]")) }
it { is_expected.to(have_field(:path).of_type("[String!]")) }
end
end

View File

@@ -0,0 +1,16 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe(Types::SellCryptoOrderType) do
subject { described_class }
describe "arguments" do
it { is_expected.to(have_a_field(:id).of_type("ID!")) }
it { is_expected.to(have_a_field(:currency).of_type("Currency!")) }
it { is_expected.to(have_a_field(:paid_amount).of_type("String!")) }
it { is_expected.to(have_a_field(:received_amount_cents).of_type("Int")) }
it { is_expected.to(have_a_field(:status).of_type("ProcessStatus!")) }
it { is_expected.to(have_a_field(:created_at).of_type("ISO8601DateTime!")) }
it { is_expected.to(have_a_field(:updated_at).of_type("ISO8601DateTime!")) }
end
end