This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe RingOfPower do | |
it 'takes a name in the constructor' do | |
my_precious = RingOfPower.new('The One Ring') | |
my_precious.name.should eq('The One Ring') | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe(@"Sting", ^{ | |
it(@"does not glow, normally", ^{ | |
[[theValue([Sting uniqueInstance].isGlowing) should] beFalse]; | |
}); | |
context(@"there's an orc about", ^{ | |
__block Orc *anOrc = nil; | |
beforeEach(^{ | |
anOrc = [[Orc alloc] init]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beforeEach(^{ messageStore = [[MessageStore alloc] init]; }); // uninitialized | |
afterEach(^{ messageStore = nil; }); | |
it(@"says whether you can archive messages in the current folder", ^{ | |
[[theBlock(^{ [messageStore canArchiveThreads]; }) should] raise]; | |
messageStore.mode = MessageStoreInbox; | |
[[theValue(messageStore.canArchiveThreads) should] equal:theValue(YES)]; | |
messageStore.mode = MessageStoreSent; | |
[[theValue(messageStore.canArchiveThreads) should] equal:theValue(NO)]; | |
messageStore.mode = MessageStoreArchive; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it(@"lets you archive an item from the inbox only", ^{ | |
messageStore.mode = MessageStoreInbox; | |
[messageStore addThreadIDs:@[@123, @234, @345]]; | |
messageStore.mode = MessageStoreSent; | |
[[theBlock(^{ [messageStore archiveThreadAtIndex:1u to:1u]; }) should] raise]; | |
messageStore.mode = MessageStoreArchive; | |
[messageStore addThreadIDs:@[@456, @567, @678]]; | |
[[theBlock(^{ [messageStore archiveThreadAtIndex:1u to:1u]; }) should] raise]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (void)swapMethod:(SEL)origM withMethod:(SEL)newM inClass:(Class)class { | |
Method origMethod = class_getInstanceMethod(class, origM); | |
Method newMethod = class_getInstanceMethod(class, newM); | |
if (class_addMethod(class, origM, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) { | |
class_replaceMethod(class, newM, method_getImplementation(origMethod), method_getTypeEncoding(origMethod)); | |
} else { | |
method_exchangeImplementations(origMethod, newMethod); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"Date Card" value:@"date_stream_user_0" traits:UIAccessibilityTraitNone]]; | |
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Date Card" value:@"date_stream_user_0" traits:UIAccessibilityTraitNone atPoint:CGPointMake(1, 1)]]; | |
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"View All Dates"]]; | |
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"View All Dates"]]; | |
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:NSLocalizedString(@"Ask_Out", @"")]]; | |
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:NSLocalizedString(@"Ask_Out", @"")]]; | |
[scenario addStep:[KIFTestStep stepToWaitForViewWithAccessibilityLabel:@"Upgrade to connect\nwith date_stream_user_0"]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[scenario addStep:[KIFTestStep stepWithDescription:@"HAWMessageThreads table should be empty" executionBlock:^(KIFTestStep *step, NSError **error) { | |
NSArray *threads = [HAWMessageThread MR_findAll]; | |
KIFTestCondition(threads.count == 0, error, @"Threads table should have no threads"); | |
return KIFTestStepResultSuccess; | |
}]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git submodule init | |
git submodule update | |
xcodebuild -scheme HAWCommonTestsCL -sdk iphonesimulator \ | |
TEST_AFTER_BUILD=YES -arch i386 clean build | grep "BUILD SUCCEEDED" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module UserLevels | |
extend ActiveSupport::Concern | |
included do | |
def signposting_level | |
signpost_count = Signpost | |
.where(user_id: self.id) | |
.where('created_at > ?', 3.months.ago) | |
.count | |
return 3 if signpost_count > 60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= content_tag(:body, { | |
class: [ | |
current_user.signposting_level_class | |
] | |
} %> | |
<%# The rest of the page %> | |
<% end %> |
OlderNewer