require 'rails_helper'

feature 'Target files show page' do
  background { i_am_logged_in_as_admin }

  scenario "download button when completed" do
    target_file = create 'target_file/my_target'
    target_file.execute_generation_process
    target_file.should be_completed

    visit "/dunlop/target_files/#{target_file.id}"

    page.should have_content "Download"
  end

  scenario "no download button when not completed" do
    target_file = create 'target_file/my_target'
    target_file.should be_new

    visit "/dunlop/target_files/#{target_file.id}"

    page.should_not have_content "Download"
  end
end

