Sha256: 54d820772bef54067999796fc4dd1da8f5a1399523612896918b3320f5784857
Contents?: true
Size: 1.48 KB
Versions: 28
Compression:
Stored size: 1.48 KB
Contents
require 'spec_helper' feature 'Progressive Tips', organization_workspace: :test do let(:user) { create(:user) } let(:haskell) { create(:haskell) } let!(:problem) { build(:problem, name: 'Succ1', description: 'Description of Succ1', layout: :input_right, assistance_rules: [{when: :submission_failed, then: ['try this', 'try that']}] ) } let(:assignment) { problem.assignment_for(user) } let!(:chapter) { create(:chapter, name: 'Functional Programming', lessons: [ create(:lesson, name: 'getting-started', description: 'An awesome guide', language: haskell, exercises: [problem]) ]) } before { reindex_current_organization! } context 'visit failed exercise' do before { set_current_user! user } before { assignment.update! status: :failed } scenario '2 failed submissions' do assignment.update! attempts_count: 2 visit "/exercises/#{problem.slug}" expect(page).to have_text('Try this') expect(page).to_not have_text('Try that') end scenario '5 failed submissions' do assignment.update! attempts_count: 5 visit "/exercises/#{problem.id}" expect(page).to_not have_text('Try this') expect(page).to have_text('Try that') end scenario '10 failed submissions' do assignment.update! attempts_count: 10 visit "/exercises/#{problem.id}" expect(page).to_not have_text('Try this') expect(page).to have_text('Try that') end end end
Version data entries
28 entries across 28 versions & 1 rubygems