Skip to content

Commit b4072dd

Browse files
committed
Adds check for enabled state.
1 parent 72dea8d commit b4072dd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Demo/DemoTests/AlertActionTests.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,17 @@ class AlertActionTests: QuickSpec {
4343

4444
it("disables the alert action if the Action is disabled") {
4545
let subject = UIAlertAction.Action("Hi", style: .Default)
46+
let disposeBag = DisposeBag()
4647

47-
subject.rx_action = emptyAction(Observable.just(false))
48+
subject.rx_action = emptyAction(.just(false))
49+
waitUntil { done in
50+
subject.rx_observe(Bool.self, "enabled")
51+
.take(1)
52+
.subscribeNext { _ in
53+
done()
54+
}
55+
.addDisposableTo(disposeBag)
56+
}
4857

4958
expect(subject.enabled) == false
5059
}

0 commit comments

Comments
 (0)