scenario_helper_spec.rb 1.0 KB

123456789101112131415161718192021222324252627282930
  1. require 'spec_helper'
  2. describe ScenarioHelper do
  3. let(:scenario) { users(:bob).scenarios.build(name: 'Scene', tag_fg_color: '#AAAAAA', tag_bg_color: '#000000') }
  4. describe '#style_colors' do
  5. it 'returns a css style-formated version of the scenario foreground and background colors' do
  6. style_colors(scenario).should == "color:#AAAAAA;background-color:#000000"
  7. end
  8. it 'defauls foreground and background colors' do
  9. scenario.tag_fg_color = nil
  10. scenario.tag_bg_color = nil
  11. style_colors(scenario).should == "color:#FFFFFF;background-color:#5BC0DE"
  12. end
  13. end
  14. describe '#scenario_label' do
  15. it 'creates a scenario label with the scenario name' do
  16. scenario_label(scenario).should ==
  17. '<span class="label scenario" style="color:#AAAAAA;background-color:#000000">Scene</span>'
  18. end
  19. it 'creates a scenario label with the given text' do
  20. scenario_label(scenario, 'Other').should ==
  21. '<span class="label scenario" style="color:#AAAAAA;background-color:#000000">Other</span>'
  22. end
  23. end
  24. end