-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISSUE #448: Test at program_level dup
- Loading branch information
1 parent
018a497
commit 4d61ed3
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |