Sha256: cff54601a88d1f36e34655c679ac1ec39c521de5f7bc5d2bf7d5c0fba6121eff

Contents?: true

Size: 1.61 KB

Versions: 25

Compression:

Stored size: 1.61 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(first_user) }
    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

  describe '#boxes_dropdown_list' do
    subject { helper.boxes_dropdown_list(first_user) }
    it { should have_tag 'ul', with: { class: 'dropdown-menu' }, count: 1 }
    it { should have_tag 'li', text: /^Inbox/ }
    it { should have_tag 'li', text: /^Sent/ }
    it { should have_tag 'li', text: /^All/ }
    it { should have_tag 'li', text: /^Drafts/ }
    it { should have_tag 'li', text: /^Trash/ }
    it { should have_tag 'li', text: /^Ignored/ }
  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

25 entries across 25 versions & 1 rubygems

Version Path
message_train-0.5.2 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.5.1 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.5.0 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.4.6 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.4.5 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.4.4 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.4.3 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.4.2 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.4.1 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.4.0 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.3.1 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.3.0 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.2.12 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.2.11 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.2.10 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.2.9 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.2.8 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.2.7 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.2.6 spec/helpers/message_train/boxes_helper_spec.rb
message_train-0.2.5 spec/helpers/message_train/boxes_helper_spec.rb