From 740f4e3811696c7359bf0d6ed861cd16d09e2da1 Mon Sep 17 00:00:00 2001 From: Espen Antonsen Date: Wed, 3 Jun 2009 22:12:11 +0200 Subject: [PATCH] test env. added cucumber et al --- app/views/collections/_form.html.erb | 6 ++++++ app/views/collections/edit.html.erb | 12 ++++++++++++ app/views/collections/new.html.erb | 9 +++++++++ app/views/collections/show.html.erb | 5 +++++ app/views/photos/show.html.erb | 3 +++ config/database.yml | 7 ++++++- config/environments/test.rb | 7 ++++++- 7 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 app/views/collections/_form.html.erb create mode 100644 app/views/collections/edit.html.erb create mode 100644 app/views/collections/new.html.erb diff --git a/app/views/collections/_form.html.erb b/app/views/collections/_form.html.erb new file mode 100644 index 0000000..1700453 --- /dev/null +++ b/app/views/collections/_form.html.erb @@ -0,0 +1,6 @@ +<%= form.label :title, :Title, {:class => 'big'} %>
+<%= form.text_field :title, {:class => 'big'} %>
+ +<%= form.label :description %>
+<%= form.text_area :description %>
+
\ No newline at end of file diff --git a/app/views/collections/edit.html.erb b/app/views/collections/edit.html.erb new file mode 100644 index 0000000..59f1d30 --- /dev/null +++ b/app/views/collections/edit.html.erb @@ -0,0 +1,12 @@ +

Edit collection

+ +<% form_for @collection do |f| %> + <%= f.error_messages %> + <%= render :partial => "form", :object => f %> + <%= f.submit "Update" %> +<% end %> + +
<%= link_to("Delete collection", { :action => "destroy", :id => @collection }, + :confirm => "Are you sure you want to delete this collection?", + :method => :delete) %> +
<%= link_to "All collections", collections_path %> \ No newline at end of file diff --git a/app/views/collections/new.html.erb b/app/views/collections/new.html.erb new file mode 100644 index 0000000..46fa177 --- /dev/null +++ b/app/views/collections/new.html.erb @@ -0,0 +1,9 @@ +

New collection

+ +<% form_for @collection do |f| %> + <%= f.error_messages %> + <%= render :partial => "form", :object => f %> + <%= f.submit "Create" %> +<% end %> + +
<%= link_to "All collections", collections_path %> \ No newline at end of file diff --git a/app/views/collections/show.html.erb b/app/views/collections/show.html.erb index 58b4055..b4585a7 100644 --- a/app/views/collections/show.html.erb +++ b/app/views/collections/show.html.erb @@ -1 +1,6 @@ +

<%= h @collection.title %>

+

<%= h @collection.description %>

<%= render :partial => @collection.albums %> + +
<%= link_to "Update collection", edit_collection_path(@collection) %> +
<%= link_to "All collections", collections_path %> \ No newline at end of file diff --git a/app/views/photos/show.html.erb b/app/views/photos/show.html.erb index 797820f..0c59af3 100644 --- a/app/views/photos/show.html.erb +++ b/app/views/photos/show.html.erb @@ -4,6 +4,9 @@
Tagged with: <%= @photo.tag_list %>

<%= @photo.description %>

+<% if @current_user.role.access_to("photo_note") %> +

<%= @photo.note %>

+<% end %>
<%= link_to "Update photo details", edit_photo_path(@photo) %>
<%= link_to "Back to #{@photo.album.title}", @photo.album %>
<%= link_to "All albums", albums_path %> \ No newline at end of file diff --git a/config/database.yml b/config/database.yml index e09cec9..086e80d 100644 --- a/config/database.yml +++ b/config/database.yml @@ -9,4 +9,9 @@ production: username: photogallery password: changeme database: gallery_production - socket: /var/run/mysqld/mysqld.sock \ No newline at end of file + socket: /var/run/mysqld/mysqld.sock +test: + adapter: postgresql + database: gallery_test + username: gallery + password: changeme diff --git a/config/environments/test.rb b/config/environments/test.rb index d6f80a4..48d4d85 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -25,4 +25,9 @@ config.action_mailer.delivery_method = :test # Use SQL instead of Active Record's schema dumper when creating the test database. # This is necessary if your schema can't be completely dumped by the schema dumper, # like if you have constraints or database-specific column types -# config.active_record.schema_format = :sql \ No newline at end of file +# config.active_record.schema_format = :sql + +config.gem "rspec" +config.gem "rspec-rails" +config.gem "webrat" +config.gem "cucumber" \ No newline at end of file