Sha256: 48ba3a66495c3031d8302b4ee0af39577f2214b4c39a05d308ba2ae9ca4bcc38

Contents?: true

Size: 706 Bytes

Versions: 43

Compression:

Stored size: 706 Bytes

Contents

require 'foreman_tasks_test_helper'

module Queries
  class TaskQueryTest < GraphQLQueryTestCase
    let(:query) do
      <<-GRAPHQL
      query (
        $id: String!
      ) {
        task(id: $id) {
          id
          action
          result
        }
      }
      GRAPHQL
    end

    let(:res) { 'inconclusive' }
    let(:task) { FactoryBot.create(:some_task, :result => res) }

    let(:global_id) { Foreman::GlobalId.for(task) }
    let(:variables) { { id: global_id } }
    let(:data) { result['data']['task'] }

    test 'should fetch task data' do
      assert_empty result['errors']

      assert_equal global_id, data['id']
      assert_equal task.result, data['result']
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
foreman-tasks-10.0.1 test/graphql/queries/task_query_test.rb
foreman-tasks-10.0.0 test/graphql/queries/task_query_test.rb
foreman-tasks-9.2.3 test/graphql/queries/task_query_test.rb
foreman-tasks-9.2.2 test/graphql/queries/task_query_test.rb
foreman-tasks-9.2.1 test/graphql/queries/task_query_test.rb
foreman-tasks-9.2.0 test/graphql/queries/task_query_test.rb
foreman-tasks-9.1.1 test/graphql/queries/task_query_test.rb
foreman-tasks-9.0.4 test/graphql/queries/task_query_test.rb
foreman-tasks-9.1.0 test/graphql/queries/task_query_test.rb
foreman-tasks-9.0.2 test/graphql/queries/task_query_test.rb
foreman-tasks-9.0.1 test/graphql/queries/task_query_test.rb
foreman-tasks-8.3.3 test/graphql/queries/task_query_test.rb
foreman-tasks-9.0.0 test/graphql/queries/task_query_test.rb
foreman-tasks-8.2.1 test/graphql/queries/task_query_test.rb
foreman-tasks-8.1.4 test/graphql/queries/task_query_test.rb
foreman-tasks-8.3.2 test/graphql/queries/task_query_test.rb
foreman-tasks-8.3.1 test/graphql/queries/task_query_test.rb
foreman-tasks-8.1.3 test/graphql/queries/task_query_test.rb
foreman-tasks-8.3.0 test/graphql/queries/task_query_test.rb
foreman-tasks-8.2.0 test/graphql/queries/task_query_test.rb