diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-12-19 19:58:40 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-12-19 19:58:40 +0200 |
commit | aef944ba7f4b580ae8ab725424c8e923e9a097f8 (patch) | |
tree | 9d234679d0a3dae31b4aed7b951fe126b34ab552 /spec | |
parent | 3958330edc5aa6044ebe90382fd901834ecfa821 (diff) | |
parent | 0760ba3efb7566b9f56bb066f4b15ba8ea34e1e7 (diff) | |
download | gitlab-ce-aef944ba7f4b580ae8ab725424c8e923e9a097f8.tar.gz |
Merge branch 'atomaka/feature/message-colors' of https://github.com/atomaka/gitlabhq into 6-5-dev
Diffstat (limited to 'spec')
-rw-r--r-- | spec/factories/broadcast_messages.rb | 4 | ||||
-rw-r--r-- | spec/helpers/broadcast_messages_helper_spec.rb | 21 | ||||
-rw-r--r-- | spec/models/broadcast_message_spec.rb | 2 |
3 files changed, 27 insertions, 0 deletions
diff --git a/spec/factories/broadcast_messages.rb b/spec/factories/broadcast_messages.rb index 84dea945025..ad16edaf2ef 100644 --- a/spec/factories/broadcast_messages.rb +++ b/spec/factories/broadcast_messages.rb @@ -9,6 +9,8 @@ # alert_type :integer # created_at :datetime not null # updated_at :datetime not null +# color :string(255) +# font :string(255) # # Read about factories at https://github.com/thoughtbot/factory_girl @@ -19,5 +21,7 @@ FactoryGirl.define do starts_at "2013-11-12 13:43:25" ends_at "2013-11-12 13:43:25" alert_type 1 + color "#555" + font "#BBB" end end diff --git a/spec/helpers/broadcast_messages_helper_spec.rb b/spec/helpers/broadcast_messages_helper_spec.rb new file mode 100644 index 00000000000..1338ce4873d --- /dev/null +++ b/spec/helpers/broadcast_messages_helper_spec.rb @@ -0,0 +1,21 @@ +require 'spec_helper' + +describe BroadcastMessagesHelper do + describe 'broadcast_styling' do + let(:broadcast_message) { double(color: "", font: "") } + + context "default style" do + it "should have no style" do + broadcast_styling(broadcast_message).should match('') + end + end + + context "customiezd style" do + before { broadcast_message.stub(color: "#f2dede", font: "#b94a48") } + + it "should have a customized style" do + broadcast_styling(broadcast_message).should match('background-color:#f2dede;color:#b94a48') + end + end + end +end diff --git a/spec/models/broadcast_message_spec.rb b/spec/models/broadcast_message_spec.rb index 998e89fa26a..cf0b36a2830 100644 --- a/spec/models/broadcast_message_spec.rb +++ b/spec/models/broadcast_message_spec.rb @@ -9,6 +9,8 @@ # alert_type :integer # created_at :datetime not null # updated_at :datetime not null +# color :string(255) +# font :string(255) # require 'spec_helper' |