Use Any_instance_of In Rspec

tips of rails stub which is called any_instance_of

How To Check Method Calling In Rspec

You can check a method is called or not by using receive in rspec. describe "#method" do it "should call method_b" do @user = Persion.new expect(@user).to...

Things To Be Aware Of When Change Capybara Default_wait_time

About Capybara.default_wait_time According to api document... find will wait for a set amount of time and continuously retry finding the element until...

Feature Test Tips Using Capybara

Can not find element PART 1 Capybara can not find invisible element by default. You need set visible option like this. find(selector, visible: false) true -...

When Let Is Called In Rspec

Outline When let / let! syntax is called in Rspec. ? let Use let to define a memoized helper method and you can execute it when you want to do. But it can...

When Before Syntax Is Called In Rspec

Outline When before syntax is called in Rspec. ? Example describe "before spec example" do before(:all) do # do somthing all(1) end before(:each) do # do...

How To Set Subdomain In Rails Rspec

context "subdomain test" do it "should return subdomain" do request.host = "subdomain." + request.host expect(get_subdomain).to eq("subdomain") end end

How To Find Invisible Element Using Capybara

Capybara don't find invisible element. page.find("#delete-button") In this case if #delete-button element has display: hidden or any other invisible style...

Use Capybara-Webkit In Rails Rspec

About Capybara-webkit Capybara-webkit is a headless browser. It can execute javascript. (capybara can't execute javascript.) If you want to do integration...