spec/helpers/dashboard_helper_spec.rb in woople-theme-0.6.14 vs spec/helpers/dashboard_helper_spec.rb in woople-theme-0.6.17
- old
+ new
@@ -53,17 +53,19 @@
end
end
context 'accordion inner' do
user1 = {
+ id: 1,
image: '/assets/retina_thumb/missing.png',
name: 'Christopher Mudiappahpillai',
member_dashboard_path: '/member_dashboards/2757',
status_color: :red,
status_description: '3 essentials and 123 elective points required.'
}
user2 = {
+ id: 2,
image: 'https://woople.s3.amazonaws.com/gwar.jpg',
name: 'Joannou Ng',
member_dashboard_path: '/member_dashboards/113037',
status_color: :yellow,
status_description: '7 essentials and 113 elective points required.'
@@ -91,9 +93,32 @@
page.all('.status-alert span')[i].text.should eq user[:status_description]
end
page.should have_css 'button.btn.btn-primary i.icon-envelope-alt.icon-white', count: 2
end
+ end
+ end
+
+ describe '#user_and_status' do
+ data = {
+ image: '/assets/retina_thumb/missing.png',
+ name: 'Christopher Mudiappahpillai',
+ status_color: :red,
+ status_description: '3 essentials and 123 elective points required.'
+ }
+
+ subject do
+ helper.user_and_status data
+ end
+
+ it 'renders the user and status' do
+ page = Capybara::Node::Simple.new subject
+
+ page.find('img')[:src].should eq '/assets/woople-theme/missing-profile.png'
+ page.find('.span5 span').text.should eq data[:name]
+ page.find('.status-alert')[:class].should eq 'alert alert-error status-alert'
+ page.find('.status-alert strong').text.should eq data[:status_color].to_s.capitalize!
+ page.find('.status-alert span').text.should eq data[:status_description]
end
end
describe "#essentials_section" do
subject do