mirror of
https://github.com/zhigang1992/redpotion.git
synced 2026-01-12 17:43:23 +08:00
Fixed find to match rmq in UIView and UIViewController
This commit is contained in:
@@ -86,8 +86,4 @@ class UIView
|
||||
def stylesheet=(value)
|
||||
rmq.stylesheet = value
|
||||
end
|
||||
|
||||
def find(*args)
|
||||
rmq(self).find(*args)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -51,10 +51,6 @@ class UIViewController
|
||||
rmq.stylesheet = value
|
||||
end
|
||||
|
||||
def find(*args)
|
||||
rmq(self.view).find(*args)
|
||||
end
|
||||
|
||||
def self.stylesheet(style_sheet_class)
|
||||
@rmq_style_sheet_class = style_sheet_class
|
||||
end
|
||||
|
||||
@@ -225,12 +225,12 @@ describe 'UIView' do
|
||||
end
|
||||
|
||||
it "should set use the proper context to find the children" do
|
||||
@view.find(UIButton).count.should.equal(1)
|
||||
find(@view).find(UIButton).count.should.equal(1)
|
||||
end
|
||||
|
||||
it "should properly work with multiple arguments as well" do
|
||||
@view.append(UILabel).tag(:something)
|
||||
@view.find(UIButton, :something).count.should.equal(2)
|
||||
find(@view).find(UIButton, :something).count.should.equal(2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user