我正在尝试从Heroku发送和运行电子邮件.目前我可以通过http://blog.heroku.com/archives/2009/11/9/tech_sending_email_with_gmail/上的"教程"从Heroku发送电子邮件,这样就可以了.
我目前的问题是,当我在Heroku工作时,我无法让它在开发中工作.我已经启动并运行了environment.rb或development.rb中的设置,但是在教程中的内容启动后我删除了env/dev.rb中的设置它不起作用.
在浏览器中我得到错误消息:(
530-5.5.1 Authentication Required. Learn more at在了解更多信息后切断)
在服务器控制台中,我收到错误消息:
Net::SMTPAuthenticationError (530-5.5.1 Authentication Required. Learn more at
):
我已heroku config:add GMAIL_SMTP_USER=username@gmail.com和heroku config:add GMAIL_SMTP_PASSWORD=yourpassword(我的信息;)),但它并不能帮助.
我有什么想法我做错了吗?
我可以在开发中使用旧方法并以某种方式跳过heroku脚本吗?
干杯卡尔
我想问题是我不知道如何正确使用Rspec的工厂女孩.或者正确地测试导轨.仍然认为它有点奇怪..
我有一个类,User,有以下工厂:
FactoryGirl.define do
factory :user do
name "admin"
email "admin@admin.com"
adminstatus "1"
password "foobar"
password_confirmation "foobar"
end
factory :user_no_admin, class: User do
name "user"
email "user@user.com"
adminstatus "2"
password "foobar"
password_confirmation "foobar"
end
...
Run Code Online (Sandbox Code Playgroud)
我的测试看起来像这样:
...
describe "signin as admin user" do
before { visit login_path }
describe "with valid information" do
let(:user_no_admin) { FactoryGirl.create(:user_no_admin) }
let(:user) { FactoryGirl.create(:user) }
before do
fill_in "User", with: user.name
fill_in "Password", with: user.password
click_button "Login"
end
it "should list users if user …Run Code Online (Sandbox Code Playgroud) 我想这很简单,但我无法让它发挥作用.我在app/assets/javascript中的help.js中有一个脚本.
这是加载的,如果我添加一个alert()它运行,但当我尝试调用javascript(jquery click())没有任何反应.如果我在页面中有javascript代码,则可以在页面底部使用.
我想资产中的包含放在页面的开头,然后我的脚本将无法正常工作.所以...
help.js
$('.clickme').click(function() {
$('#working').show();
var htmlStr = this.getAttribute('data-message');
$('#helper_box').html(htmlStr);
$('#helper_box').toggle('slow', function() {
// Animation complete.
$('#working').hide();
});
});
Run Code Online (Sandbox Code Playgroud)
index.html.erb
<div class="clickme" data-message="Something...">
<%= image_tag("question_mark.png", :alt => "helper") %><br>
</div>
Run Code Online (Sandbox Code Playgroud)