나는 ruby on rails 튜토리얼에서 작업 해왔다. 나는이 물건에 완전히 새로운 것이다. 나는 9 장에서 완전히 붙어있다. 누군가가 오류 메시지를 해독하도록 도와 줄 수 있기를 바랍니다. 지금까지 나는 방금 그들을 검색하고 알아 냈습니다.하지만 문제를 해결하기 위해 오류 메시지를 해독하는 방법을 배우는 것이 더 중요하다고 생각합니다. 만약 너무 길거나 설명하기가 번거 롭다면, 아무도 그것을하고 싶어하지 않는다면 완전히 이해할 것입니다. 나는 이것으로 스스로 도울 수있는 온라인 무언가를 찾을 수 없었다. 여기 ruby on rails 튜토리얼 오류 9 장
내가 현재 무엇입니까 오류를이다 유효한 정보 인증으로 로그인 절차1) AuthenticationPages 비 로그인 한 사용자가 원하는 보호 페이지
렌더링해야 로그인 후 보호 된 페이지를 방문 할 때 유효 정보 인증으로 로그인 절차Failure/Error: click_button "Sign in"
Capybara::ElementNotFound:
Unable to find button "Sign in"
# ./spec/requests/authentication_pages_spec.rb:61:in `block (7 levels) in <top (required)>'
2) AuthenticationPages 비 로그인 한 편집 페이지
Failure/Error: it { should have_title('Sign in') }
expected #has_title?("Sign in") to return true, got false
# ./spec/requests/authentication_pages_spec.rb:76:in `block (8 levels) in <top (required)>'
를 방문하는 사용자 컨트롤러의 사용자 유효 정보 인증으로 로그인 절차
3) AuthenticationPages 비 로그인 한 사용자가 잘못된 사용자 방문 사용자 # 편집 페이지와 사용자 컨트롤러에서 비 로그인에 대한 올바른 정보 인증으로 로그인 절차
Failure/Error: before { sign_in user, no_capybara: true }
NoMethodError:
undefined method `sign_in' for #<RSpec::Core::ExampleGroup::Nested_2::Nested_2::Nested_2::Nested_2::Nested_1::Nested_2::Nested_3::Nested_1:0xabbb9e4>
# ./spec/requests/authentication_pages_spec.rb:87:in `block (8 levels) in <top (required)>'
4) AuthenticationPages 6.6 초 만에 완성 사용자 # 업데이트 작업을
Failure/Error: before { sign_in user, no_capybara: true }
NoMethodError:
undefined method `sign_in' for #<RSpec::Core::ExampleGroup::Nested_2::Nested_2::Nested_2::Nested_2::Nested_1::Nested_2::Nested_3::Nested_2:0xa82d354>
# ./spec/requests/authentication_pages_spec.rb:87:in `block (8 levels) in <top (required)>'
에 PATCH 요청을 제출 잘못된 사용자와 사용자의 컨트롤러의 사용자 65 예, 4 개 실패
실패 예 :
RSpec에 ./spec/requests/authentication_pages_spec.rb:66 # 유효 정보 인증으로 로그인 절차 AuthenticationPages 비 로그인 한 사용자 가에서해야 로그인 한 후 보호 된 페이지를 방문 할 때 시도 원하는 보호 된 페이지를 렌더링
RSpec에 ./spec/requests/authentication_pages_spec.rb:76 번호에 대한 올바른 정보 인증으로 로그인 절차 AuthenticationPages 비 로그인 한 편집 페이지
를 방문하는 사용자 컨트롤러의 사용자 16,RSpec에 대한 올바른 정보 인증으로 로그인 절차 ./spec/requests/authentication_pages_spec.rb:91 # AuthenticationPages 비 로그인 한 사용자 # 편집 페이지를 사용자에게
RSpec에 방문 잘못된 사용자와 사용자의 컨트롤러 ./ 사양/요청/authentication_pages_spec.rb : 96 # 사용자 # 업데이트 작업을
본격에 PATCH 요청을 제출 잘못된 사용자와 사용자의 컨트롤러 비 로그인 한 사용자에 대한 올바른 정보 인증으로 로그인했습니다 AuthenticationPages ication_pages_spec.rb
require 'spec_helper'
describe "AuthenticationPages" do
subject { page }
describe "signin page" do
before { visit signin_path }
it { should have_content('Sign in') }
it { should have_title('Sign in') }
end
describe "signin" do
before { visit signin_path }
describe "with invalid information" do
before { click_button "Sign in" }
it { should have_title('Sign in') }
it { should have_selector('div.alert.alert-error', text: 'Invalid') }
describe "after visiting another page" do
before { click_link "Home" }
it { should_not have_selector('div.alert.alert-error', text: 'Invalid') }
end
end
describe "with valid information" do
let(:user) { FactoryGirl.create(:user) }
before do
fill_in "Email", with: user.email.upcase
fill_in "Password", with: user.password
click_button "Sign in"
end
it { should have_title(user.name) }
it { should have_link('Profile', href: user_path(user)) }
it { should have_link('Settings', href: edit_user_path(user)) }
it { should have_link('Sign out', href: signout_path) }
it { should_not have_link('Sign in', href: signin_path) }
describe "followed by signout" do
before { click_link "Sign out" }
it { should have_link('Sign in') }
end
describe "authorization" do
describe "for non-signed-in users" do
let(:user) { FactoryGirl.create(:user) }
describe "when attempting to visit a protected page" do
before do
visit edit_user_path(user)
fill_in "Email", with: user.email
fill_in "Password", with: user.password
click_button "Sign in"
end
describe "after signing in" do
it "should render the desired protected page" do
expect(page).to have_title('Edit user')
end
end
end
describe "in the Users controller" do
describe "visiting the edit page" do
before { visit edit_user_path(user) }
it { should have_title('Sign in') }
end
describe "submitting to the update action" do
before { patch user_path(user) }
specify { expect(response).to redirect_to(signin_path) }
end
describe "as wrong user" do
let(:user) { FactoryGirl.create(:user) }
let(:wrong_user) { FactoryGirl.create(:user, email: "[email protected]") }
before { sign_in user, no_capybara: true }
describe "visiting Users#edit page" do
before { visit edit_user_path(wrong_user) }
it { should_not have_title(full_title('Edit user')) }
end
describe "submitting a PATCH request to the User#update action" do
before { patch user_path(wrong_user) }
specify { expect(response).to redirect_to(root_url) }
end
end
end
end
end
end
end
end
user_pages_spec.rb
require 'spec_helper'
describe "User pages" do
subject { page }
describe "signup page" do
before { visit signup_path }
it { should have_content('Sign up') }
it { should have_title(full_title('Sign up')) }
end
describe "signup" do
before { visit signup_path }
let(:submit) { "Create my account" }
describe "with invalid information" do
it "should not create a user" do
expect { click_button submit }.not_to change(User, :count)
end
describe "after submission" do
before { click_button submit }
it { should have_title('Sign up') }
it { should have_content('error') }
end
describe "with valid information" do
before do
fill_in "Name", with: "Example User"
fill_in "Email",with: "[email protected]"
fill_in "Password", with: "foobar"
fill_in "Confirmation", with: "foobar"
end
it "should create a new user" do
expect { click_button submit }.to change(User, :count).by(1)
end
describe "after saving the user" do
before { click_button submit }
let(:user) { User.find_by(email: '[email protected]') }
it { should have_title(user.name) }
it { should have_selector('div.alert.alert-success', text: 'Welcome') }
end
it "should create a user" do
expect { click_button submit }.to change(User, :count).by(1)
end
describe "edit" do
let(:user) {FactoryGirl.create(:user) }
before do
sign_in user
visit edit_user_path(user)
end
describe "page" do
it { should have_content("Update your profile") }
it { should have_title("Edit user") }
it { should have_link('change', href: 'http://gravatar.com/emails') }
end
describe "with invalid information" do
before { click_button "Save changes" }
it { should have_content('error') }
end
describe "with valid information" do
let(:new_name) { "New Name" }
let(:new_email) { "[email protected]" }
before do
fill_in "Name", with: new_name
fill_in "Email", with: new_email
fill_in "Password", with: user.password
fill_in "Confirm Password", with: user.password
click_button "Save changes"
end
it { should have_title(new_name) }
it { should have_selector('div.alert.alert-success') }
it { should have_link('Sign out', href: signout_path) }
specify { expect(user.reload.name).to eq new_name }
specify { expect(user.reload.email).to eq new_email }
end
end
end
end
end
end
특히 "블록 (7 단계)"의 의미는 무엇인지 궁금합니다. 해당 페이지에서 레벨이 무언가입니까? 아니면 다른 것을 언급하고 있습니까? '블록'이란 무엇입니까?
나는 또한 내가 얻는 카피 바라의 오류를 이해하는 것처럼 보일 수 없다. 8 장에 나타나서 떠났고 지금 돌아 왔습니다. 내가 capybara가 그것을 추측 할 정도로 그것을 끌어 올릴 때 버튼이 페이지에있다. 아무도 그 작동 원리를 설명 할 수 있습니까?
이를 깨 '좋은 웹 사이트? "
를 참조 중첩되어하는아는 사람을 무엇? 나는 나 자신을 일을하기 위해보다 더 행복 할 것입니다하지만 난 하나를 찾을 수 없습니다. 내가 정말로 사랑 그냥 인터넷 검색을하고 어딘가 대답을 기대하거나 모든 시간을 설명하기 위해 다른 사람에 의존하는 대신 자신이 해독 할 수 있습니다. 귀하의 시간과 어떤 도움
정말 고마워요. 이제
자세한 답변을 주셔서 감사합니다. –