Sha256: 54725aa92a8916fcce7c923c543661e1a360df5cab10723176c5da0f381d9685

Contents?: true

Size: 619 Bytes

Versions: 10

Compression:

Stored size: 619 Bytes

Contents

require 'spec_helper'

describe ReportsKit::FormBuilder do
  subject { described_class.new(properties) }

  context 'with a datetime dimension' do
    let(:properties) do
      {
        measure: 'issue',
        filters: [
          {
            key: 'opened_at',
            criteria: {
              operator: 'between',
              value: '-1w - now'
            }
          }
        ]
      }
    end

    it 'transforms the filter criteria' do
      expect(subject.date_range('opened_at')).to include("#{format_configuration_time(1.week.ago)} - #{format_configuration_time(Time.zone.now)}")
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
reports_kits-0.7.8 spec/reports_kit/form_builder_spec.rb
reports_kits-0.7.7 spec/reports_kit/form_builder_spec.rb
reports_kit-0.7.1 spec/reports_kit/form_builder_spec.rb
reports_kit-0.7.0 spec/reports_kit/form_builder_spec.rb
reports_kit-0.5.0 spec/reports_kit/form_builder_spec.rb
reports_kit-0.4.1 spec/reports_kit/form_builder_spec.rb
reports_kit-0.4.0 spec/reports_kit/form_builder_spec.rb
reports_kit-0.3.3 spec/reports_kit/form_builder_spec.rb
reports_kit-0.3.2 spec/reports_kit/form_builder_spec.rb
reports_kit-0.3.1 spec/reports_kit/form_builder_spec.rb