Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 4 Rspec 3.1当前url==http://test.host/venues v应用==http://www.example.com/venues_Ruby On Rails 4_Rspec3 - Fatal编程技术网

Ruby on rails 4 Rspec 3.1当前url==http://test.host/venues v应用==http://www.example.com/venues

Ruby on rails 4 Rspec 3.1当前url==http://test.host/venues v应用==http://www.example.com/venues,ruby-on-rails-4,rspec3,Ruby On Rails 4,Rspec3,我正在用rspec 3.1测试rails应用程序,期望如下: expect(current_url).to eq venues_url 这将导致以下故障: Failure/Error: expect(current_url).to eq venues_url expected: "http://test.host/venues" got: "http://www.example.com/venues" 为什么期望域与应用程序指向的域之间存在差异 如果我

我正在用rspec 3.1测试rails应用程序,期望如下:

expect(current_url).to eq venues_url
这将导致以下故障:

Failure/Error: expect(current_url).to eq venues_url

       expected: "http://test.host/venues"
            got: "http://www.example.com/venues"
为什么期望域与应用程序指向的域之间存在差异

如果我使用
expect(当前路径),则测试通过。使用expect(当前路径)