Skip to content

Commit

Permalink
Merge pull request #1824 from internetee/1822-upgrade-ui-registrar-tests
Browse files Browse the repository at this point in the history
added test for registrar account activities
  • Loading branch information
vohmar authored Jan 28, 2021
2 parents 07eb5c8 + ea5586a commit 3cc4d4e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/system/registrar_area/account_activities_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require 'application_system_test_case'

class RegistrarAccountActivitiesTest < ApplicationSystemTestCase
setup do
@registrar = registrars(:bestnames)
sign_in users(:api_bestnames)
end

def test_show_account_activity_page
account_activities(:one).update(sum: "123.00")
visit registrar_account_activities_path
assert_text 'Account activity'
end

def test_download_account_activity
now = Time.zone.parse('2010-07-05 08:00')
travel_to now
account_activities(:one).update(sum: "123.00")

get registrar_account_activities_path(format: :csv)

assert_response :ok
assert_equal "text/csv", response.headers['Content-Type']
assert_equal %(attachment; filename="account_activities_#{Time.zone.now.to_formatted_s(:number)}.csv"; filename*=UTF-8''account_activities_#{Time.zone.now.to_formatted_s(:number)}.csv),
response.headers['Content-Disposition']
assert_not_empty response.body
end
end

0 comments on commit 3cc4d4e

Please sign in to comment.