【问题标题】:syntax error, unexpected end-of-input, expecting keyword_end. when running rspec of feature file语法错误,意外的输入结束,期待关键字结束。运行功能文件的 rspec 时
【发布时间】:2019-11-02 02:41:37
【问题描述】:
require_relative 'rails_helper'
require 'spec_helper'

RSpec.feature "testCreateVideo", :type => :feature do
  context 'create new video 'do
    scenario "Successfully creates a new video" do
      visit "https://SomeURL/orders"

      within('form') do

        fill_in "order[organisation][name]", :with => "SAMPLE BRAND NAME"
        fill_in "order[organisation][website]", :with => "SAMPLE WEBSITE"
        select "option", from:  "select box", :with => "Singapore"
        select "option", from:  "select box", :with => "Central"
        choose('order[project][name]', option: 'time_frame_next_week')
        choose('order[project][budget]', option: 'up-to-five')
        fill_in "#order_project_description", with: 'sample description'
        fill_in "order[project][videos_we_like_tmp]", :with => "My Widget"
        fill_in "order[contact][first_name]", :with => "John Christian"
        fill_in "order[contact][last_name]", :with => "Dela Pena"
        fill_in "order[contact][email]", :with => "christianmamac08@gmail.com"
        fill_in "order[contact][mobile]", :with => "65 8134 9249"
        check('accepts_terms')

      end

      click_button ('button')

      expect(page).to have_text("Thank you for creating your quote.")
    end

    scenario "should fail creating video" do
      visit "https://someURL/orders"

      within('form') do

        #fill_in "order[organisation][name]", :with => "SAMPLE BRAND NAME"
        fill_in "order[organisation][website]", :with => "SAMPLE WEBSITE"
        select "option", from:  "select box", :with => "Singapore"
        select "option", from:  "select box", :with => "Central"
        choose('order[project][name]', option: 'time_frame_next_week')
        choose('order[project][budget]', option: 'up-to-five')
        fill_in "#order_project_description", with: 'sample description'
        fill_in "order[project][videos_we_like_tmp]", :with => "My Widget"
        fill_in "order[contact][first_name]", :with => "John Christian"
        fill_in "order[contact][last_name]", :with => "Dela Pena"
        fill_in "order[contact][email]", :with => "christianmamac08@gmail.com"
        fill_in "order[contact][mobile]", :with => "65 8134 9249"
        check('accepts_terms')
      end
      click_button ('button')

      expect(page).to have_text("Brand Name is missing.")

    end
end

【问题讨论】:

    标签: ruby-on-rails ruby windows rspec capybara


    【解决方案1】:

    你最后错过了一个end,在这两个ends之间,哈哈

    离开

        end
    end
    

        end
      end
    end
    

    【讨论】:

    • 我在笑,因为我的句子充满了结尾。这么烦人吗?
    • 好吧,我只是想帮助OP,不想装专业
    • 还是一样。在我添加了一个“结束”之后。我的代码有问题吗?我是 Rails 新手。
    • @ChristianMamac:也许你错过了另一个。或者你的代码被spring什么的缓存了。
    • @ChristianMamac 你确定错误在同一个文件中吗?看来这个文件只是漏掉了一个结尾
    猜你喜欢
    • 2013-09-18
    • 1970-01-01
    • 1970-01-01
    • 2016-05-14
    • 1970-01-01
    • 1970-01-01
    • 2015-11-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多