Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added public/download to .gitignore
* completed BackupsController new/show views * added part in BackupsController create to display error messages (hack)
- Loading branch information
Showing
9 changed files
with
131 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ tags | |
public/cache/**/* | ||
doc/* | ||
coverage/* | ||
public/download/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<h1>BackupMyMail</h1> | ||
|
||
<% form_for :remote_mail, :url => { :action => :create } do |f| %> | ||
<%= f.error_messages %> | ||
|
||
<p> | ||
<%= f.label :email_address %> | ||
<%= f.text_field :email_address %> | ||
</p> | ||
<p> | ||
<%= f.label :server %> | ||
<%= f.text_field :server %> | ||
</p> | ||
<p> | ||
<%= f.label :username %> | ||
<%= f.text_field :username %> | ||
</p> | ||
<p> | ||
<%= f.label :password %> | ||
<%= f.password_field :password %> | ||
</p> | ||
<p> | ||
<%= f.label :ssl, "SSL" %> | ||
<%= f.check_box :ssl %> | ||
</p> | ||
<p> | ||
<%= f.label :port %> | ||
<%= f.text_field :port %> | ||
</p> | ||
<p> | ||
<%= f.submit "Backup!" %> | ||
</p> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<h1>BackupMyMail Downloads</h1> | ||
<p>To download, right click on the link and left click on "Save as" or your browser's equivalent."</p> | ||
<% @downloads.each do |name, filename| %> | ||
<p><%= link_to name, "/download/#{filename}" %></p> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') | ||
|
||
describe "/backups/new" do | ||
before(:each) do | ||
@remote_mail = mock_model( RemoteMail ) | ||
valid_pop3_attributes.each do |key, value| | ||
@remote_mail.stub!(key).and_return( value ) | ||
end | ||
assigns[:remote_mail] = @remote_mail | ||
end | ||
|
||
it "should render new form" do | ||
render 'backups/new' | ||
response.should have_tag("form[action=?][method=post]", '/backups/create') do | ||
with_tag( "input#remote_mail_email_address[name=?]", "remote_mail[email_address]" ) | ||
with_tag( "input#remote_mail_server[name=?]", "remote_mail[server]" ) | ||
with_tag( "input#remote_mail_username[name=?]", "remote_mail[username]" ) | ||
with_tag( "input#remote_mail_password[name=?][type=password]", "remote_mail[password]" ) | ||
with_tag( "input#remote_mail_ssl[name=?]", "remote_mail[ssl]" ) | ||
with_tag( "input#remote_mail_port[name=?]", "remote_mail[port]" ) | ||
with_tag( "input[type=submit]" ) | ||
end | ||
end | ||
|
||
it "should display error notices" do | ||
@remote_mail = RemoteMail.new | ||
@remote_mail.save | ||
assigns[:remote_mail] = @remote_mail | ||
render 'backups/new' | ||
|
||
response.should have_tag("form[action=?][method=post]", '/backups/create') do | ||
with_tag( "div[id=errorExplanation]" ) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') | ||
|
||
describe "/backups/show" do | ||
before(:each) do | ||
assigns[:downloads] = { :inbox => MBOX_NAME } | ||
render 'backups/show' | ||
end | ||
|
||
it "should show download link" do | ||
response.should have_tag( "a[href=?]", "/download/#{MBOX_NAME}", "inbox" ) | ||
end | ||
end |