Skip to content

Commit

Permalink
In bulk upload RSpec tests, verify success by actually looking at dat…
Browse files Browse the repository at this point in the history
…abase changes instead of just checking for the "success" message.
  • Loading branch information
gsrohde committed Mar 17, 2017
1 parent 7e9561c commit c106e74
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/features/bulk_upload_integration_2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@
describe "How parsing of variables in the heading works" do

specify "A variable in the heading should be recognized even if it isn't in the trait_covariate_associations table" do
pending "A working implementation for the feature in issue #459"
visit '/bulk_upload/start_upload'
attach_file 'CSV file', Rails.root.join('spec',
'fixtures',
Expand All @@ -553,7 +554,7 @@
expect(page).not_to have_content('error')
click_link 'Specify'
click_button 'Confirm'
click_button 'Insert Data'
expect { click_button 'Insert Data' }.to change { Trait.count }.by( 2 ).and change { Covariate.count }.by 2;
expect(first("div.alert-success")).to have_content("Data from valid-test-data-with-traits-not-in-associations-table.csv was successfully uploaded.")
end

Expand Down Expand Up @@ -581,7 +582,7 @@
expect(page).not_to have_content('error')
click_link 'Specify'
click_button 'Confirm'
click_button 'Insert Data'
expect { click_button 'Insert Data' }.to change { Trait.count }.by( 2 ).and change { Covariate.count }.by 2;
expect(first("div.alert-success")).to have_content("Data from valid-test-data.csv was successfully uploaded.")
end

Expand All @@ -600,7 +601,7 @@
click_button 'Upload'
click_link 'Specify'
click_button 'Confirm'
click_button 'Insert Data'
expect { click_button 'Insert Data' }.to change { Trait.count }.by( 2 ).and change { Covariate.count }.by 2;
expect(first("div.alert-success")).to have_content("Data from blank_cells_in_notes_column.csv was successfully uploaded.")
end

Expand Down

0 comments on commit c106e74

Please sign in to comment.