Sha256: ee9a4f3729a2ce909009b335852b08e071737803066a3a3d39446db928afade2

Contents?: true

Size: 848 Bytes

Versions: 28

Compression:

Stored size: 848 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

feature 'Analytics' do
  describe 'Timing how long completing a questionnaire took' do
    let(:questionnaire) { Quby.questionnaires.find("simple") }

    it 'stores the first time the answer was opened' do
      answer         = nil
      time_opened    = Time.new(2014, 4, 1, 12, 23, 32)
      time_completed = Time.new(2014, 4, 1, 12, 25, 11)

      Timecop.freeze(time_opened) do
        answer = visit_new_answer_for(questionnaire)
      end

      Timecop.freeze(time_completed) do
        choose "answer_v_1_a1"
        click_on "Klaar"
        expect(page).to have_content("Uw antwoorden zijn opgeslagen")
      end

      expect(Quby.answers.reload(answer).started_at).to   eq(time_opened)
      expect(Quby.answers.reload(answer).completed_at).to eq(time_completed)
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
quby-5.5.0 spec/features/analytics_spec.rb
quby-5.4.0 spec/features/analytics_spec.rb
quby-5.3.1 spec/features/analytics_spec.rb
quby-5.3.0 spec/features/analytics_spec.rb
quby-5.2.0 spec/features/analytics_spec.rb
quby-5.1.3 spec/features/analytics_spec.rb
quby-5.1.2 spec/features/analytics_spec.rb
quby-5.1.1 spec/features/analytics_spec.rb
quby-5.1.0 spec/features/analytics_spec.rb
quby-5.0.5 spec/features/analytics_spec.rb
quby-5.0.4 spec/features/analytics_spec.rb
quby-5.0.3 spec/features/analytics_spec.rb
quby-5.0.2 spec/features/analytics_spec.rb
quby-5.0.1 spec/features/analytics_spec.rb
quby-5.0.0 spec/features/analytics_spec.rb
quby-4.0.4 spec/features/analytics_spec.rb
quby-5.0.0.pre4 spec/features/analytics_spec.rb
quby-5.0.0.pre3 spec/features/analytics_spec.rb
quby-5.0.0.pre2 spec/features/analytics_spec.rb
quby-5.0.0.pre1 spec/features/analytics_spec.rb