Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented blue star case #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions update_quality.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

def update_quality(awards)
awards.each do |award|
if award.name != 'Blue First' && award.name != 'Blue Compare'
#applied blue star logc here
if award.name == 'Blue Star'
if award.quality > 0
award.quality -= award.expires_in > 0 ? 2 : 4
end
elsif award.name != 'Blue First' && award.name != 'Blue Compare'
if award.quality > 0
if award.name != 'Blue Distinction Plus'
award.quality -= 1
Expand Down Expand Up @@ -32,7 +37,7 @@ def update_quality(awards)
if award.name != 'Blue First'
if award.name != 'Blue Compare'
if award.quality > 0
if award.name != 'Blue Distinction Plus'
unless ['Blue Distinction Plus', 'Blue Star'].include?(award.name)
award.quality -= 1
end
end
Expand All @@ -47,3 +52,5 @@ def update_quality(awards)
end
end
end


2 changes: 1 addition & 1 deletion update_quality_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
end

context 'given a Blue Star award' do
before { pending }

let(:name) { 'Blue Star' }
before { award.expires_in.should == initial_expires_in-1 }

Expand Down