How does a POST request to a staging site work?


I’m working on an app written in Ruby on Rails with GraphQL API. In my test file, I sent a POST request to our staging site in order to execute a sign in mutation. This is the test file:

require 'test_helper'

class Mutations::SignInUserTest < ActionDispatch::IntegrationTest
    def perform(args = {}) nil, field: nil, context: {}).resolve(args)

    test 'sign in user' do
        post ""

        user = perform(
            auth: {
                user_id: "example",
                password: "example"

        assert user.persisted?

However, in test.log, this is what I see when I run rails test

Started POST "/graphql" for at 2021-06-16 00:06:27 +0700
Processing by GraphqlController#execute as HTML
Completed 200 OK in 32ms (Views: 0.3ms | ActiveRecord: 0.0ms)

Note that I have a Dockerfile and a docker-compose.yml in my root directory, ran docker-compose up then docker exec into the container of our app to run rails test. Does the log mean that the POST request is being sent to my localhost:3000/graphql? I’m asking because the staging database should have user data for signing in, but for some reason the database is empty when I run the tests, so all the queries and mutations return null.
I also have a .sql file in my root directory, is there a way to import the data in the file into my database so I can test it?

Source: Docker Questions

Categorised as docker, graphql, ruby-on-rails, unit-testing Tagged , , ,


Leave a Reply

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us