2012-03-28 114 views
5

试图点击与元音按钮时我收到此错误:

syntax error, unexpected $end, expecting keyword_end 
       click_on 'Neue Firma hinzufц╪gen' 

我用Ruby & Capabara测试。

##Create_User_spec.rb 
require 'acceptance/acceptance_helper' 
## Feature 'Create User' 
feature 'Create User' do ## 
Scenario 'Create a User' 
scenario 'Create a User' do 
    ## Login into the service 
    visit 'url' 
    fill_in 'User-username', :with => 'test' 
    fill_in 'User-password', :with => 'test' 
    click_on 'login' 
    click_link 'Test' 
    click_on 'Neue Firma hinzufügen' 
end 
end 
+1

请出示该页面的代码.. – Kashiftufail 2012-03-28 10:48:42

+2

如果您正确缩进您的代码,您将更有可能自己检测到此类错误。 – 2013-02-12 21:37:02

回答

3

这个错误是由于额外的结束。意思是你已经写了一个额外的结束没有匹配的做。

+1

## Create_User_spec.rb 需要 '接受/ acceptance_helper' ##功能 '创建用户' 功能 '创建用户' 做 \t ##方案 '创建用户' \t情景 '创建用户'做 \t \t \t ##登录到服务 \t \t访问 'URL' \t \t FILL_IN '用户名',:用=> '测试' \t \t FILL_IN '用户口令',:与=> '测试' \t \t click_on '登录' \t \t \t \t \t click_link '测试' \t \t click_on '抵达Neue丰资本hinzufügen' \t端 端 – mancho1981 2012-03-28 10:52:24

+1

Create_User_spec 。RB需要“接受/ acceptance_helper” 功能“创建用户”功能“创建用户”做 结束 方案“创建用户”情景“创建用户”做 登录到服务访问“网址” FILL_IN“用户名'::with =>'test'fill_in'用户密码',:with =>'test'click_on'login'click_link'测试'click_on'Neue Firmahinzufügen' end – Kashiftufail 2012-03-28 10:56:17

+0

现在检查!!!!!!!因为你终于写了一个额外的结束关键字...... – Kashiftufail 2012-03-28 10:56:41

8

此,如果你有一只流浪.尾随的方法也有可能发生,所以请那些为好。

0

这发生在我身上,但因为我错过了一个结局。我下面这个教程

http://tutorials.jumpstartlab.com/projects/blogger.html

我的模式是:

class ArticlesController < ApplicationController 
    def index 
    @articles = Article.all 
    end 

它需要的是:

class ArticlesController < ApplicationController 
    def index 
    @articles = Article.all 
    end 
end 

希望帮助别人。

7

它发生在我身上,因为特殊字符,在我的情况下葡萄牙的迹象。我相信问题在于hinzufügen的“ü”。尚未找到解决方案。

编辑:找到了解决办法!

添加以下的RB文件的顶部:

#编码:UTF-8

(不要错过#符号,它是需要)

相关问题