Add csv download test #2691

This commit is contained in:
Martin Lensment 2015-07-07 12:57:40 +03:00
parent 715e052dcd
commit fafbba20d6
2 changed files with 9 additions and 0 deletions

View file

@ -1,3 +1,5 @@
require 'csv'
class AccountActivity < ActiveRecord::Base class AccountActivity < ActiveRecord::Base
include Versions include Versions
belongs_to :account belongs_to :account

View file

@ -27,5 +27,12 @@ feature 'Account activity', type: :feature do
current_path.should == '/registrar/account_activities' current_path.should == '/registrar/account_activities'
page.should have_text('+110.0 EUR') page.should have_text('+110.0 EUR')
end end
it 'should download csv' do
visit '/registrar/account_activities'
click_link 'Export CSV'
response_headers['Content-Type'].should == 'text/csv'
response_headers['Content-Disposition'].should match(/attachment; filename="account_activities_\d+\.csv"/)
end
end end
end end