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-8.1.2 test/graphql/queries/task_query_test.rb
foreman-tasks-8.1.1 test/graphql/queries/task_query_test.rb
foreman-tasks-8.1.0 test/graphql/queries/task_query_test.rb
foreman-tasks-8.0.2 test/graphql/queries/task_query_test.rb
foreman-tasks-8.0.1 test/graphql/queries/task_query_test.rb
foreman-tasks-8.0.0 test/graphql/queries/task_query_test.rb
foreman-tasks-7.2.1 test/graphql/queries/task_query_test.rb
foreman-tasks-7.1.1 test/graphql/queries/task_query_test.rb
foreman-tasks-7.2.0 test/graphql/queries/task_query_test.rb
foreman-tasks-7.1.0 test/graphql/queries/task_query_test.rb
foreman-tasks-6.0.3 test/graphql/queries/task_query_test.rb
foreman-tasks-7.0.0 test/graphql/queries/task_query_test.rb
foreman-tasks-6.0.2 test/graphql/queries/task_query_test.rb
foreman-tasks-5.2.3 test/graphql/queries/task_query_test.rb
foreman-tasks-6.0.1 test/graphql/queries/task_query_test.rb
foreman-tasks-5.2.2 test/graphql/queries/task_query_test.rb
foreman-tasks-6.0.0 test/graphql/queries/task_query_test.rb
foreman-tasks-5.2.1 test/graphql/queries/task_query_test.rb
foreman-tasks-5.3.0 test/graphql/queries/task_query_test.rb
foreman-tasks-5.2.0 test/graphql/queries/task_query_test.rb