gpt4 book ai didi

ruby-on-rails - rspec - 我怎样才能让 "pendings"有我的文本而不仅仅是 "No reason given"

转载 作者:数据小太阳 更新时间:2023-10-29 07:12:14 25 4
gpt4 key购买 nike

我有这个代码:

context "Visiting the users #index page." do
before(:each) { visit users_path }
subject { page }
pending('iii') { should have_no_css('table#users') }
pending { should have content('You have reached this page due to a permiss

ionic 错误') }

它会导致几个待处理,例如

Managing Users Given a practitioner logged in. Visiting the users #index page.
# No reason given
# ./spec/requests/role_users_spec.rb:78
Managing Users Given a practitioner logged in. Visiting the users #index page.
# No reason given
# ./spec/requests/role_users_spec.rb:79

我怎样才能让那些未决的有文字而不是“没有给出理由”

我试过在 pending 之后和 block 之前放置一些文本,但这没有帮助 - 它出现在行尾 - 但我仍然有所有“没有给出理由”。

最佳答案

pending 本身就是一个方法,正常的用例是这样的:

  it "should say yo" do
pending "that's right, yo"
subject.yo!.should eq("yo!")
end

那会输出

Pending:
Yo should say yo
# that's right, yo
# ./yo.rb:8

所以,当你想使用短格式时,比如

its(:yo!) {should eq("yo!") }

然后要标记为待处理,您有几个选择:

xits(:you!) {should eq("yo!") }
pending(:you!) {should eq("yo!")}

但要获得带有消息的挂起,您应该这样做:

its(:yo!) {pending "waiting on client"; should eq("yo!") }

这会给你输出

  Yo yo! 
# waiting for client
# ./yo.rb:16

关于ruby-on-rails - rspec - 我怎样才能让 "pendings"有我的文本而不仅仅是 "No reason given",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11614224/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com