Skip to content

Commit

Permalink
Switching transparency default to “opaque”
Browse files Browse the repository at this point in the history
  • Loading branch information
alxjrvs committed Jul 30, 2018
1 parent 64dba03 commit 540fa13
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/google/event.rb
Expand Up @@ -216,10 +216,10 @@ def extended_properties
# You can pass true or false. Defaults to transparent.
#
def transparency=(val)
if val == false || val.to_s.downcase == 'opaque'
@transparency = 'opaque'
else
if val == true || val.to_s.downcase == 'transparent'
@transparency = 'transparent'
else
@transparency = 'opaque'
end
end

Expand Down
21 changes: 18 additions & 3 deletions test/test_google_calendar.rb
Expand Up @@ -502,15 +502,30 @@ class TestGoogleCalendar < Minitest::Test
end

context "transparency" do
should "be transparent" do
@event = Event.new(:transparency => true)
assert @event.transparent?
should "be opaque when nil" do
@event = Event.new
assert @event.opaque?
end

should "be opaque when transparency = opaque" do
@event = Event.new(:transparency => 'opaque')
assert @event.opaque?
end

should "be opaque?" do
@event = Event.new(:transparency => false)
assert @event.opaque?
end

should "be transparent" do
@event = Event.new(:transparency => true)
assert @event.transparent?
end

should "be transparent when transparency = transparent" do
@event = Event.new(:transparency => 'transparent')
assert @event.transparent?
end
end

context "event json" do
Expand Down

0 comments on commit 540fa13

Please sign in to comment.