Skip to content

Commit

Permalink
ISSUE #448: Test at program_level dup
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMonardez committed Dec 13, 2024
1 parent 018a497 commit 4d61ed3
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions spec/features/program_level_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'ProgramLevel', js: true do

let!(:program_level) { FactoryBot.create :program_level }
let(:role) { FactoryBot.create :role_administrador }
let(:user) { create_confirmed_user(role) }
context 'edit', js: true do
before(:each) do
login_as(user)
visit program_levels_path
end
it 'on update with different levels, should duplicate the old version' do
expect(find(".level-column").text).to eq(program_level.level.to_s)
expect(find(".start_date-column").text).to eq(I18n.l(program_level.start_date, format: :long))
visit edit_program_level_path(program_level)
fill_in "record[level]", with: "2"
click_on "Atualizar"
page.refresh
expect(ProgramLevel.count).to eq(2)
end
end
end

0 comments on commit 4d61ed3

Please sign in to comment.