Sha256: 40fc3c05105282ba6b646dc9aa9047e43d7046946ec5204440f6b8ab064218be

Contents?: true

Size: 1.33 KB

Versions: 8

Compression:

Stored size: 1.33 KB

Contents

require 'rails_helper'

describe MessageTrain::BoxesHelper do
  include_context 'loaded site'
  include ControllerMacros

  before do
    login_user first_user
  end
  context '#box_nav_item' do
    subject { helper.box_nav_item(first_user.box(:in)) }
    it { should have_tag 'li', text: /Inbox/ }
    it { should have_tag 'span', text: /[0-9]+/, with: { class: 'badge' } }
  end

  context '#box_list_item' do
    subject { helper.box_list_item(first_user.box(:in), class: 'foo') }
    it { should have_tag 'li', text: /Inbox/, with: { class: 'foo' } }
    it { should have_tag 'span', text: /[0-9]+/, with: { class: 'badge' } }
  end

  context '#boxes_widget' do
    subject { helper.boxes_widget }
    it { should have_tag 'h3', text: /Messages/ }
    it { should have_tag 'ul', with: { class: 'list-group' } }
    it { should have_tag 'li', with: { class: 'list-group-item' }, count: 6 }
  end

  context '#boxes_dropdown_list' do
    subject { helper.boxes_dropdown_list }
    it { should have_tag 'ul', with: { class: 'dropdown-menu' } }
    it { should have_tag 'li', minimum: 5 }
  end

  context '#box_participant_slug' do
    subject { helper.box_participant_slug(first_user) }
    it { should eq 'first-user' }
  end

  context '#box_participant_name' do
    subject { helper.box_participant_name(first_user) }
    it { should eq 'First User' }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
message_train-0.1.7 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.1.6 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.1.5 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.1.4 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.1.3 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.1.2 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.1.1 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.1.0 spec/helpers/message_train/boxes_helper_spec.rb