请帮助解决问题。我使用rspec + capybara + pry。
试验:
// Global Variable
int[] myInt;
int mySize = 1;
private void button1_Click(object sender, EventArgs e)
{
if (mySize > 1)
{
int[] tempInt = new int[mySize];
tempInt = myInt;
myInt = new int[mySize];
for (int i = 0; i < mySize - 1; i++)
{
myInt[i] = tempInt[i];
}
myInt[mySize - 1] = mySize;
}
else
{
myInt = new int[mySize];
myInt[mySize - 1] = mySize;
}
mySize++;
}
结果:
it 'check albums page' do
user = FactoryGirl.create(:user)
visit user_albums_path(user.id)
expect(response.status).to eq(200)
expect(response).to render_template(:index)
expect(page).to have_selector(".albums_list_label")
end
我需要向concole显示页面内容(DOM)。我尝试使用gem'prey':
Failures:
1) AlbumsController index action check albums page
Failure/Error: expect(page).to have_selector(".albums_list_label")
expected to find css ".albums_list_label" but there were no matches
# ./spec/controllers/albums_controller_spec.rb:18:in `block (3 levels) in <top (required)>'
结果我在控制台中获得了调试模式:
it 'check albums page' do
user = FactoryGirl.create(:user)
visit user_albums_path(user.id)
expect(response.status).to eq(200)
expect(response).to render_template(:index)
binding.pry
expect(page).to have_selector(".albums_list_label")
end
但我不知道如何将DOM输出到控制台