3 class UserBlocksHelperTest < ActionView::TestCase
4 include ApplicationHelper
7 block = create(:user_block, :needs_view, :ends_at => Time.now.getutc)
8 assert_equal I18n.t("user_block.helper.until_login"), block_status(block)
10 block_end = Time.now.getutc + 60.minutes
11 block = create(:user_block, :needs_view, :ends_at => block_end)
12 assert_equal I18n.t("user_block.helper.time_future_and_until_login", :time => friendly_date(block_end)), block_status(block)
14 block_end = Time.now.getutc + 60.minutes
15 block = create(:user_block, :ends_at => block_end)
16 assert_equal I18n.t("user_block.helper.time_future", :time => friendly_date(block_end)), block_status(block)