Sha256: fcb832710175a2619d09edd4f2a0ed337350114de792e239c6f80875cf7a7cd1

Contents?: true

Size: 743 Bytes

Versions: 44

Compression:

Stored size: 743 Bytes

Contents

require 'foreman_tasks_test_helper'

module Queries
  class RecurringLogicTest < GraphQLQueryTestCase
    let(:query) do
      <<-GRAPHQL
      query($id: String!) {
        recurringLogic(id: $id) {
          id
          cronLine
        }
      }
      GRAPHQL
    end

    let(:cron_line) { '5 4 3 2 1' }
    let(:recurring_logic) { FactoryBot.create(:recurring_logic, :cron_line => cron_line) }
    let(:global_id) { Foreman::GlobalId.for(recurring_logic) }
    let(:variables) { { id: global_id } }
    let(:data) { result['data']['recurringLogic'] }

    test "should fetch recurring logic" do
      assert_empty result['errors']
      assert_equal global_id, data['id']
      assert_equal cron_line, data['cronLine']
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
foreman-tasks-5.2.0 test/graphql/queries/recurring_logic_test.rb
foreman-tasks-5.1.1 test/graphql/queries/recurring_logic_test.rb
foreman-tasks-5.1.0 test/graphql/queries/recurring_logic_test.rb
foreman-tasks-5.0.0 test/graphql/queries/recurring_logic_test.rb