我正在使用Koala gem来发出facebook请求,我有以下代码:
@graph = Koala::Facebook::API.new(oauth_token)
@graph.batch do |batch_api|
#... do stuff here
end
Run Code Online (Sandbox Code Playgroud)
我想模拟批量调用来模拟我们在那里做的事情.
这是我在RR中所拥有的.
oauth_token= "Sometoken"
batch_api_mock = nil
graph_mock = mock(Koala::Facebook::API).new(oauth_token).mock!
graph_mock.batch.returns do
yield batch_api_mock if block_given?
end
Run Code Online (Sandbox Code Playgroud)
问题是block_given?即使在我的源代码中传递了一个块,它也会返回false.
我如何使用RR模拟一个采用块的方法?
如果您转到颜色选择器并选择线性渐变,则始终会获得水平线性渐变.如何将渐变旋转90度以创建在adobe flash professional cs5或6中从上到下移动的渐变?
我的问题源于无法在圆角矩形上创建垂直线性渐变.我可以变换和旋转按钮以获得正确的渐变,但按钮边缘会变形.
我开始:

我结束:

这是我正在使用的颜色选择器.我没有看到渐变的角度选项.

我有以下内容:
class Email
include ::Mongoid::Timestamps
include ::Mongoid::Document
field :email_address, :type => String
field :user_id, :type => Integer
field :campaign, :type => String
field :stream, :type => String
field :component, :type => String
embeds_many :actions
end
Run Code Online (Sandbox Code Playgroud)
并且rails抱怨它无法找到字段方法定义.有人知道为什么吗?