1
1
require 'spec_helper'
2
2
3
- RSpec . describe AchievementsController , : type => :controller do
4
- describe 'awarding badges' do
5
- let ( :api_key ) { " abcd" }
3
+ RSpec . describe AchievementsController , type : :controller , skip : true do
4
+ describe 'awarding badges' do
5
+ let ( :api_key ) { ' abcd' }
6
6
7
- it 'should award 24pullrequests badges' do
8
- api_access = Fabricate ( :api_access , api_key : api_key , awards : %w( TwentyFourPullRequestsParticipant2012 TwentyFourPullRequestsContinuous2012 ) )
9
- participant = Fabricate ( :user , github : " bashir" )
10
- post :award , badge : 'TwentyFourPullRequestsParticipant2012' , date : '12/24/2012' , github : participant . github , api_key : api_key
11
- expect ( participant . badges . count ) . to eq ( 1 )
12
- participant . badges . first . is_a? TwentyFourPullRequestsParticipant2012
13
- post :award , badge : 'TwentyFourPullRequestsContinuous2012' , date : '12/24/2012' , github : participant . github , api_key : api_key
14
- expect ( participant . badges . count ) . to eq ( 2 )
15
- participant . badges . last . is_a? TwentyFourPullRequestsContinuous2012
16
- end
7
+ it 'should award 24pullrequests badges' do
8
+ api_access = Fabricate ( :api_access , api_key : api_key , awards : %w( TwentyFourPullRequestsParticipant2012 TwentyFourPullRequestsContinuous2012 ) )
9
+ participant = Fabricate ( :user , github : ' bashir' )
10
+ post :award , badge : 'TwentyFourPullRequestsParticipant2012' , date : '12/24/2012' , github : participant . github , api_key : api_key
11
+ expect ( participant . badges . count ) . to eq ( 1 )
12
+ participant . badges . first . is_a? TwentyFourPullRequestsParticipant2012
13
+ post :award , badge : 'TwentyFourPullRequestsContinuous2012' , date : '12/24/2012' , github : participant . github , api_key : api_key
14
+ expect ( participant . badges . count ) . to eq ( 2 )
15
+ participant . badges . last . is_a? TwentyFourPullRequestsContinuous2012
16
+ end
17
17
18
- it 'should fail to allow awards with no api key' do
19
- api_access = Fabricate ( :api_access , api_key : api_key , awards : %w( TwentyFourPullRequestsParticipant2012 TwentyFourPullRequestsContinuous2012 ) )
20
- participant = Fabricate ( :user , github : " bashir" )
21
- post :award , badge : 'TwentyFourPullRequestsParticipant2012' , date : '12/24/2012' , github : participant . github
22
- expect ( participant . badges . count ) . to eq ( 0 )
23
- end
18
+ it 'should fail to allow awards with no api key' do
19
+ api_access = Fabricate ( :api_access , api_key : api_key , awards : %w( TwentyFourPullRequestsParticipant2012 TwentyFourPullRequestsContinuous2012 ) )
20
+ participant = Fabricate ( :user , github : ' bashir' )
21
+ post :award , badge : 'TwentyFourPullRequestsParticipant2012' , date : '12/24/2012' , github : participant . github
22
+ expect ( participant . badges . count ) . to eq ( 0 )
23
+ end
24
24
25
- it 'should fail to allow awards if api_key does not have award privileges for the requested badge' do
26
- api_access = Fabricate ( :api_access , api_key : api_key , awards : %w( TwentyFourPullRequestsParticipant2012 TwentyFourPullRequestsContinuous2012 ) )
27
- participant = Fabricate ( :user , github : " bashir" )
28
- post :award , badge : 'SomeRandomBadge' , date : '12/24/2012' , github : participant . github , api_key : api_key
29
- expect ( participant . badges . count ) . to eq ( 0 )
30
- end
31
- end
32
- end
25
+ it 'should fail to allow awards if api_key does not have award privileges for the requested badge' do
26
+ api_access = Fabricate ( :api_access , api_key : api_key , awards : %w( TwentyFourPullRequestsParticipant2012 TwentyFourPullRequestsContinuous2012 ) )
27
+ participant = Fabricate ( :user , github : ' bashir' )
28
+ post :award , badge : 'SomeRandomBadge' , date : '12/24/2012' , github : participant . github , api_key : api_key
29
+ expect ( participant . badges . count ) . to eq ( 0 )
30
+ end
31
+ end
32
+ end
0 commit comments