Sha256: ece8b5d6762ec7baf4bca26e8ad28f0c54d3bbcac3496a2105b691b048890558
Contents?: true
Size: 998 Bytes
Versions: 26
Compression:
Stored size: 998 Bytes
Contents
require "rails_helper" RSpec.describe "#redirect_back_or", :type => :feature do let(:user) { create(:user) } it "stores the location when authorizing" do create(:permission, element_name: "articles", read_right: true, owner: user) visit "/articles" # redirect to login path fill_in "Name", with: user.name fill_in "Password", with: "12341" click_button "Login" expect(page.current_path).to eq "/articles" end it "stores the location when requiring login" do visit "/comments" # redirect to login path fill_in "Name", with: user.name fill_in "Password", with: "12341" click_button "Login" expect(page.current_path).to eq "/comments" end it "doesn't store the location if the HTTP method isn't GET" do visit "/comments/new" click_button "Create a comment" # redirect to login path fill_in "Name", with: user.name fill_in "Password", with: "12341" click_button "Login" expect(page.current_path).to eq "/" end end
Version data entries
26 entries across 26 versions & 1 rubygems