Ruby Tests is a Sublime Text 2 plugin for running ruby tests! (Unit, RSpec, Cucumber)
Questions tagged [ruby-test]
46 questions
1
vote
0 answers
Uninitialized constant i18n
I am trying internalization testing using rspec and hence using i18n gem.
I see that I have the gem installed, but in my test I am looking for the default_locale. I did puts I18n.default_locale
I am getting 'Uninitialized constant I18n' error.
Has…

tech_human
- 6,592
- 16
- 65
- 107
1
vote
1 answer
Invalid multibyte character (US-ASCII) error
I am writing a test using ruby where I am verifying some data as per below code.
array['myLabel'].should eq '(100–200) mg/dL'
When I run the test, I am getting an error on this line.
Error is: invalid multibyte char (US-ASCII) and then below that…

tech_human
- 6,592
- 16
- 65
- 107
1
vote
1 answer
How to set up Sublime Text 2 for Ruby Tests (Windows)
I'm following the Rails Tutorial (Hartl), and having some trouble in section 3.6.4 "Tests Inside Sublime Text".
Running Windows 7 (I know, not optimal, but what I have for now).
I followed the steps at…

Scro
- 1,353
- 2
- 15
- 26
1
vote
1 answer
RubyTest errors - installing into sublime text 2
I'm trying to install rubytest as per the rails tutorial guide
I've guided it to my rspec file:
{
"erb_exec": "erb",
"ruby_unit_exec": "ruby",
"ruby_cucumber_exec": "cucumber -f pretty",
"ruby_rspec_exec":…

Joseph
- 914
- 2
- 14
- 29
0
votes
1 answer
How make stub on request with VCR?
How can I do stub on request with VCR?
The problem is that real request is made in the test, which I want to stub.
RSpec.describe CreditRegisterLoader do
describe ".call" do
it "should create credit institutions", :vcr do
…

Marco Polo
- 3
- 2
0
votes
1 answer
I am curious about the machanism about when should I use follow_rediret! and when shouldn't?
I am reading the 7th chapter about how to test submission with the form with book , and there are two test cases below, and the confusing part is about when should I use follow_redirect! and why the first case…

Jesse JunJing
- 99
- 6
0
votes
1 answer
timecop.travel test returns false instead of true - rails
I am writing a unit test to check whether 24 hours have passed. If 24 hours have passed then it should return true
here is my attempt
test "messenger tag is more than 24 hours" do
Timecop.travel 2.days.ago
account =…

kahuria00
- 317
- 1
- 5
- 14
0
votes
1 answer
How to use regexp in assert_selector ruby on rails
I have a selector that displays date and time on the page, need to write capybara test to check for just date. How to include regexp in assert_selector?
assert_selector("div", text: /"#{DateTime.now.strftime('%a %b %d, %H:%M')}"*/i)
It doesn't work…

Veda
- 577
- 1
- 6
- 22
0
votes
1 answer
My function works in practice but does not pass tests rspec
Perhaps it is my lack of familiarity with rspec but i do not understand what is going on with my test.
I have 2 classes one called Scrape, the other Result (creative) Scrape is a web scraping class that searches a site and scrapes the results from…

SVRourke
- 19
- 5
0
votes
2 answers
Test if html contains image tag with .png file Ruby
My Ruby on Rails web application sends a welcome email to clients and I want to write a test to make sure the email contains an tag where the src is a .png file. I saw assert_select might do what I want but since my email is a Mail::Message class,…

Ccyan
- 1,057
- 12
- 32
0
votes
1 answer
Is there any way to run a single test in ruby under spec/features/abc_spec.rb 'header details'?
Is there any way to run a single test in ruby under spec/features/abc_spec.rb 'header details' ?
Ex:
rake test:features spec/features/abc_spec.rb 'header details'

Rajesh
- 119
- 1
- 8
0
votes
1 answer
Chefspec mocking issue
I have two methods without class, they both have same code but return object is different.
def get_load_balancer(network_client, resource_group_name, load_balancer_name)
promise = network_client.load_balancers.get(resource_group_name,…

Samawia Moin
- 1
- 3
0
votes
1 answer
ruby rails test case failing but real app works
So here's a strange problem: When I start my local rails app and browse to http://localhost:3000/static_pages/help I can see the page I created there.
However, the test case that I wrote says otherwise.
static_pages_controller_test.rb
require…

MathKid
- 1,903
- 1
- 21
- 21
0
votes
1 answer
How does Ruby Test:Unit locate test classes in a deep nested folder?
How does Ruby Test:Unit locate test classes in a deep nested folder? I am a Java developer and I understand how JUnit and TestNG can scan folders with a defined filter to locate tests.
I am wondering if someone can explain to me how Ruby can…

djangofan
- 28,471
- 61
- 196
- 289
0
votes
1 answer
Rubytest issues with windows 7
Just started messing with sublime text 2 / ruby and I can't get rubytest working for whatever reason. I used the following link to get started (http://railsinstaller.org/en).
Essentially none of the shortcuts work to activate anything and I followed…

StackOverride
- 13
- 2