【问题标题】:TDD on Rails 4: Features testsRails 4 上的 TDD:功能测试
【发布时间】:2013-09-29 04:42:50
【问题描述】:

谁能告诉我如何在 Rails 中为帖子编辑页面进行功能测试? 我有一个帖子列表,每个帖子都有一个编辑链接。谢谢。

【问题讨论】:

    标签: ruby-on-rails unit-testing tdd


    【解决方案1】:

    你可以通过RSPEC-

    def postedit do
      before { visit posteditpage_path }
      subject { post }
    
      def posteach do
        it {should_contain editlink_path}
        end
      end
    end
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-06
      相关资源
      最近更新 更多