+++ /dev/null
-# frozen_string_literal: true
-
-module AboutHelper
-end
+++ /dev/null
-# frozen_string_literal: true
-
-module Admin::DomainBlocksHelper
-end
+++ /dev/null
-# frozen_string_literal: true
-
-module Admin::PubsubhubbubHelper
-end
+++ /dev/null
-# frozen_string_literal: true
-
-module AuthorizeFollowHelper
-end
+++ /dev/null
-# frozen_string_literal: true
-
-module TagsHelper
-end
+++ /dev/null
-# frozen_string_literal: true
-
-module XrdHelper
-end
+++ /dev/null
-require 'rails_helper'
-
-RSpec.describe AboutHelper, type: :helper do
-
-end
+++ /dev/null
-require 'rails_helper'
-
-RSpec.describe Admin::DomainBlocksHelper, type: :helper do
-
-end
+++ /dev/null
-require 'rails_helper'
-
-RSpec.describe Admin::PubsubhubbubHelper, type: :helper do
-
-end
require 'rails_helper'
-RSpec.describe ApplicationHelper, type: :helper do
+describe ApplicationHelper do
+ describe 'active_nav_class' do
+ it 'returns active when on the current page' do
+ allow(helper).to receive(:current_page?).and_return(true)
+ result = helper.active_nav_class("/test")
+ expect(result).to eq "active"
+ end
+
+ it 'returns empty string when not on current page' do
+ allow(helper).to receive(:current_page?).and_return(false)
+
+ result = helper.active_nav_class("/test")
+ expect(result).to eq ""
+ end
+ end
end
+++ /dev/null
-require 'rails_helper'
-
-RSpec.describe AuthorizeFollowHelper, type: :helper do
-
-end
RSpec.describe StreamEntriesHelper, type: :helper do
describe '#display_name' do
- pending
+ it 'uses the display name when it exists' do
+ account = Account.new(display_name: "Display", username: "Username")
+
+ expect(helper.display_name(account)).to eq "Display"
+ end
+
+ it 'uses the username when display name is nil' do
+ account = Account.new(display_name: nil, username: "Username")
+
+ expect(helper.display_name(account)).to eq "Username"
+ end
end
describe '#avatar_for_status_url' do
+++ /dev/null
-require 'rails_helper'
-
-RSpec.describe TagsHelper, type: :helper do
-
-end
+++ /dev/null
-require 'rails_helper'
-
-RSpec.describe XrdHelper, type: :helper do
-
-end